Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: OpenSSH 7.3p1 can't be build on Solaris 10

22 views
Skip to first unread message

Darren Tucker

unread,
Aug 1, 2016, 9:20:18 AM8/1/16
to
On Mon, Aug 1, 2016 at 10:54 PM, Yuri Voinov <yvo...@gmail.com> wrote:
> Solaris 10 x64 kernel 150401-35
> LibreSSL 2.4.1
> GCC 5.2

It worked for me on Solaris 10 with "gcc version 3.4.3" and Solaris 11
"gcc version 4.5.2" (both on x86) so my guess it's something specific
to newer gcc versions. Where did you get that gcc package? I'd like
to try to reproduce it.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA (new)
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-...@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

Darren Tucker

unread,
Aug 1, 2016, 10:12:32 AM8/1/16
to
On Mon, Aug 1, 2016 at 10:54 PM, Yuri Voinov <yvo...@gmail.com> wrote:
> ../openbsd-compat/openbsd-compat.h:233:23: error: expected identifier or
> '(' before numeric constant
> # define mblen(x, y) (1)

It sounds like you have mblen but configure didn't find it. Did
configure detect mblen? There should be some output from configure,
and if it didn't there should be a reason in config.log (although
it'll be buried in there somewhere).

Darren Tucker

unread,
Aug 1, 2016, 10:58:13 AM8/1/16
to
On Tue, Aug 2, 2016 at 12:42 AM, Yuri Voinov <yvo...@gmail.com> wrote:
[...]
> /opt/csw/lib/gcc/i386-pc-solaris2.10/5.2.0/include-fixed/sys/feature_tests.h:346:2:
> error: #error "Compiler or options invalid for pre-UNIX 03 X/Open
> applications and pre-2001 POSIX applications"

What's the code around line 364 of
/opt/csw/lib/gcc/i386-pc-solaris2.10/5.2.0/include-fixed/sys/feature_tests.h,
especially the enclosing ifdefs?

[..]
> Seems can't. But why? 7.2 does.

Dunno, I can't think of any obvious changes to compiler flags. Maybe
try it without setting CFLAGS?

Darren Tucker

unread,
Aug 1, 2016, 11:46:47 PM8/1/16
to
On Tue, Aug 2, 2016 at 12:52 AM, Darren Tucker <dtu...@zip.com.au> wrote:
[...]
>> Seems can't. But why? 7.2 does.
>
> Dunno, I can't think of any obvious changes to compiler flags. Maybe
> try it without setting CFLAGS?

OK, I think I see why it started in 7.3: it was when the wide
character support was added. In configure.ac:

dnl Wide character support. Linux man page says it needs _XOPEN_SOURCE.
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_XOPEN_SOURCE"
AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth])
CFLAGS="$saved_CFLAGS"

AC_LINK_IFELSE(
[AC_LANG_PROGRAM(and
[[ #include <ctype.h> ]],
[[ return (isblank('a')); ]])],
[AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).])
])

before that the mblen test didn't have XOPEN_SOURCE.

The failing condition is "if defined(_STDC_C99) &&
(defined(__XOPEN_OR_POSIX) && !defined(_XPG6))". The above explains
where the XOPEN came from. As to why you're seeing it, my guess is
your version of gcc defaults to -std=c99 and mine doesn't. You can
try adding "-std=c89" to your CFLAGS and see if it builds.

Darren Tucker

unread,
Aug 2, 2016, 12:04:52 AM8/2/16
to
On Tue, Aug 2, 2016 at 1:44 PM, Darren Tucker <dtu...@zip.com.au> wrote:
[...]
> The failing condition is "if defined(_STDC_C99) &&
> (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))". The above explains
> where the XOPEN came from. As to why you're seeing it, my guess is
> your version of gcc defaults to -std=c99 and mine doesn't. You can
> try adding "-std=c89" to your CFLAGS and see if it builds.

Alternatively, try adding -D_XPG6 to CFLAGS.

Darren Tucker

unread,
Aug 2, 2016, 12:21:19 AM8/2/16
to
On Tue, Aug 2, 2016 at 2:02 PM, Darren Tucker <dtu...@zip.com.au> wrote:
> On Tue, Aug 2, 2016 at 1:44 PM, Darren Tucker <dtu...@zip.com.au> wrote:
> [...]
>> The failing condition is "if defined(_STDC_C99) &&
>> (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))". The above explains
>> where the XOPEN came from. As to why you're seeing it, my guess is
>> your version of gcc defaults to -std=c99 and mine doesn't. You can
>> try adding "-std=c89" to your CFLAGS and see if it builds.
>
> Alternatively, try adding -D_XPG6 to CFLAGS.

That may not be the right thing. Looks like this might be a known GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40411

Darren Tucker

unread,
Aug 2, 2016, 12:56:53 AM8/2/16
to
Having read up some more I think this is what I should have done.

If you'd like to try this you will need to run "autoreconf" to rebuild
configure before running ./configure again.

diff --git a/configure.ac b/configure.ac
index 1df3cbf..542bd93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -754,6 +754,9 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
use_pie=auto
check_for_libcrypt_later=1
check_for_openpty_ctty_bug=1
+ dnl Target SUSv3/POSIX.1-2001 plus BSD specifics.
+ dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE"
AC_DEFINE([PAM_TTY_KLUDGE], [1],
[Work around problematic Linux PAM modules handling of PAM_TTY])
AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"],
@@ -1789,11 +1792,8 @@ AC_CHECK_FUNCS([ \
warn \
])

-dnl Wide character support. Linux man page says it needs _XOPEN_SOURCE.
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -D_XOPEN_SOURCE"
+dnl Wide character support.
AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth])
-CFLAGS="$saved_CFLAGS"

AC_LINK_IFELSE(
[AC_LANG_PROGRAM(

Darren Tucker

unread,
Aug 2, 2016, 7:32:49 PM8/2/16
to
On Wed, Aug 3, 2016 at 4:12 AM, Yuri Voinov <yvo...@gmail.com> wrote:
> With this change built ok.

Excellent.

> But patch must be quite different on my platform (see attached) for
> portable version.

That attached patch looks exactly like the one I sent other than the
path depth (which can be handled easily with "patch -p1"). What's
different?

Peter Stuge

unread,
Aug 2, 2016, 7:59:01 PM8/2/16
to
Darren Tucker wrote:
> What's different?

Line numbers.


//Peter
0 new messages