Bug 3278 - OpenIndiana build fails
Summary: OpenIndiana build fails
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 8.5p1
Hardware: amd64 SunOS
: P5 major
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_8_6
  Show dependency treegraph
 
Reported: 2021-03-11 21:31 AEDT by predrag.zecevic.1961
Modified: 2021-04-23 14:54 AEST (History)
1 user (show)

See Also:


Attachments
Move generic includes outside of ifdef (684 bytes, patch)
2021-03-11 23:04 AEDT, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description predrag.zecevic.1961 2021-03-11 21:31:19 AEDT
Version 8.4p1 builds OK, version 8.5p1 (both portable) build fails with error;

Undefined                       first referenced
 symbol                             in file
debug                               openbsd-compat//libopenbsd-compat.a(port-solaris.o)
fatal                               openbsd-compat//libopenbsd-compat.a(port-solaris.o)
error                               openbsd-compat//libopenbsd-compat.a(port-solaris.o)
ld: fatal: symbol referencing errors. No output written to ssh
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:207: ssh] Error 1
Build failed

Configure and make commands were same in both cases.
Regards
Comment 1 Darren Tucker 2021-03-11 21:53:29 AEDT
That's odd.  It we test here on:
$ uname -a
SunOS openindiana 5.11 illumos-6cb54de205 i86pc i386 i86pc

Which version do you have?

I notice the error is from gmake, does it do the same thing with /usr/bin/make?  (that's what I'm using)

what's also odd is that debug(), fatal() and error() are now macros defined in log.h, which is included by port-solaris.c.

Could you please show the exact configure invocation you used?
Comment 2 predrag.zecevic.1961 2021-03-11 22:28:51 AEDT
Hi,

:; uname -a
SunOS hipster 5.11 illumos-f2db47a16a i86pc i386 i86pc

I have compiled it against self compiled versions (OpenSSl, etc) all installed to PREFIX=/pz/SFW. Configure command is same for 8.4 and 8.5. (Self compiled s/w versions used in both compilation are same too):

    ./configure --prefix=${PREFIX} \
      --sysconfdir=${PREFIX}/etc/openssh \
      --with-cflags="${CFLAGS} -DHAVE_MBLEN" \
      --with-kerberos5=${PREFIX} \
      --with-ssl-dir=${PREFIX} \
      --with-zlib=${PREFIX} \
      --with-pam \
      --with-xauth=/usr/bin/xauth \
      --with-md5-passwords \
      --with-mantype=man \
      --with-solaris-projects \
      --with-solaris-privs
    gmake

After configure:

OpenSSH has been configured with the following options:
                     User binaries: /pz/SFW/bin
                   System binaries: /pz/SFW/sbin
               Configuration files: /pz/SFW/etc/openssh
                   Askpass program: /pz/SFW/libexec/ssh-askpass
                      Manual pages: /pz/SFW/share/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user PATH: /usr/ccs/bin:/usr/bin:/bin:/usr/sbin:/sbin:/pz/SFW/bin
   (If PATH is set in /etc/default/login it will be used instead. If
   used, ensure the path to scp is present, otherwise scp will not work.)
                    Manpage format: man
                       PAM support: yes
                   OSF SIA support: no
                 KerberosV support: yes
                   SELinux support: no
              MD5 password support: yes
                   libedit support: no
                   libldns support: no
  Solaris process contract support: no
           Solaris project support: yes
         Solaris privilege support: yes
       IP address in $DISPLAY hack: no
           Translate v4 in v6 hack: no
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY
             Privsep sandbox style: solaris
                   PKCS#11 support: yes
                  U2F/FIDO support: yes

              Host: x86_64-pc-solaris2.11
          Compiler: /usr/gcc/9/bin/gcc

    Compiler flags: -lstdc++ -m64 -march=native -std=c89 -std=c99 -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D__EXTENSIONS__ -I/pz/SFW/include -I/pz/SFW/apr/include -I/usr/include -I/usr/gnu/include -I/usr/include/readline -I/usr/include/ncurses -I/usr/include/idn2 -I/usr/include/gmp -DHAVE_MBLEN -pipe -Wno-error=format-truncation -Wall -Wextra -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-parameter -Wno-unused-result -Wimplicit-fallthrough -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-strong -lstdc++ -m64 -march=native -std=c89 -std=c99 -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D__EXTENSIONS__ -I/pz/SFW/include -I/pz/SFW/apr/include -I/usr/include -I/usr/gnu/include -I/usr/include/readline -I/usr/include/ncurses -I/usr/include/idn2 -I/usr/include/gmp -DHAVE_MBLEN -DHAVE_MBLEN
Preprocessor flags: -I/pz/SFW/include -I/pz/SFW/include  -I/pz/SFW/include -I/pz/SFW/include
      Linker flags: -L/pz/SFW/lib -R/pz/SFW/lib -L/pz/SFW/lib -R/pz/SFW/lib -m64 -R/pz/SFW/lib -R/pz/SFW/apr/lib -R/usr/gnu/lib/amd64 -R/usr/lib/amd64 -L/pz/SFW/lib -L/pz/SFW/apr/lib -L/usr/gnu/lib/amd64 -L/usr/lib/amd64 -Wl,-z,now -fstack-protector-strong -R/pz/SFW/lib
         Libraries: -lcrypto -lmd -lz -lresolv -lsocket -lnsl -lm -lintl -lproject
         +for sshd:  -lpam -ldl


Thanks...
Regards.
Comment 3 predrag.zecevic.1961 2021-03-11 22:33:56 AEDT
... and, I do not think that gmake/make use makes difference:

I use same shell for compiling both 8.4p1 (compiles fine) and 8.5p1 (compilation fails).

Everything else is not touched.
Comment 4 Darren Tucker 2021-03-11 22:46:33 AEDT
(In reply to predrag.zecevic.1961 from comment #2)
>       --with-solaris-projects \
>       --with-solaris-privs

I think I see the problem.  Those two are in port-solaris.c, but the include of log.h is inside #ifdef USE_SOLARIS_PROCESS_CONTRACTS, which you do not enable and thus you do not get the macros for debug and friends.

Depending on your compiler, this probably produced a missing-prototype warning in 8.4p1 but the linker was still able to do its thing.

If you stick a #include "log.h" near the top of the file immediately after #include "includes.h" does that resolve the problem?
Comment 5 Darren Tucker 2021-03-11 23:04:48 AEDT
Created attachment 3479 [details]
Move generic includes outside of ifdef

Please try this patch.
Comment 6 predrag.zecevic.1961 2021-03-11 23:11:03 AEDT
Yes, patch has solved compilation problem.

I did not tested functionality yet...

Regards.
Comment 7 predrag.zecevic.1961 2021-03-11 23:25:03 AEDT
Tested new client and all looks fine.
Will test server tomorrow, and add comment again.

Many thanks.
Regards
Comment 8 Darren Tucker 2021-03-12 13:21:19 AEDT
The patch has been committed and will be in the next release.  Thanks for the report.
Comment 9 predrag.zecevic.1961 2021-03-12 19:17:40 AEDT
Just note on server: it also works as expected.
Many thanks, again.
Comment 10 Damien Miller 2021-04-23 14:54:58 AEST
closing resolved bugs as of 8.6p1 release