Hi! Some background first.
I am currently working on cleaning up the "false dependencies" issue for secure/. The attached patch p1 fixes this. This is done by moving the false dependencies from secure/ utilities directly to libssh.so. This also requires a alight re-ordering in `libraries' target of Makefile.inc1, which is done by the attached patch p2. So far it's OK. Now the problem. I was testing these patches on an i386 -CURRENT box that does nightly "make world"s for both i386 and alpha. i386 world built OK, alpha cross-world broke trying to link secure/libexec/sftp-server as follows: : Script started on Fri Jan 25 10:09:41 2002 : -------------------------------------------------------------- : >>> Building everything.. : -------------------------------------------------------------- : cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/alpha MACHINE_ARCH=alpha MACHINE=alpha :COMPILER_PATH=/usr/obj/alpha/usr/src/i386/usr/libexec:/usr/obj/alpha/usr/src/i386/usr/bin : :LIBRARY_PATH=/usr/obj/alpha/usr/src/i386/usr/lib:/usr/obj/alpha/usr/src/i386/usr/lib :OBJFORMAT_PATH=/usr/obj/alpha/usr/src/i386/usr/libexec CINCLUDES="-nostdinc" :CXXINCLUDES="-nostdinc++" :PERL5LIB=/usr/obj/alpha/usr/src/i386/usr/libdata/perl/5.6.0 :GROFF_BIN_PATH=/usr/obj/alpha/usr/src/i386/usr/bin :GROFF_FONT_PATH=/usr/obj/alpha/usr/src/i386/usr/share/groff_font :GROFF_TMAC_PATH=/usr/obj/alpha/usr/src/i386/usr/share/tmac :DESTDIR=/usr/obj/alpha/usr/src/i386 INSTALL="sh /usr/src/tools/install.sh" :PATH=/usr/obj/alpha/usr/src/i386/usr/sbin:/usr/obj/alpha/usr/src/i386/usr/bin:/usr/obj/alpha/usr/src/i386/usr/games:/sbin:/bin:/usr/sbin:/usr/bin : make -f Makefile.inc1 all : ===> secure/libexec/sftp-server : cc -O -pipe -nostdinc -mcpu=ev4 -DNO_IDEA :-I/usr/obj/alpha/usr/src/i386/usr/include -o sftp-server sftp-server.o :sftp-common.o -lssh -lcrypto : /usr/obj/alpha/usr/src/i386/usr/libexec/elf/ld: warning: libz.so.2, needed by :/usr/obj/alpha/usr/src/i386/usr/lib/libssh.so, not found (try using -rpath or :-rpath-link) : /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so: undefined reference to `deflate' : /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so: undefined reference to `inflate' : /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so: undefined reference to `inflateInit_' : /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so: undefined reference to `deflateInit_' : /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so: undefined reference to `inflateEnd' : /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so: undefined reference to `deflateEnd' : *** Error code 1 : : Stop in /usr/src/secure/libexec/sftp-server. : *** Error code 1 : : Script done on Fri Jan 25 10:09:42 2002 The ld(1) error message above says (formatted by fmt(1)): : /usr/obj/alpha/usr/src/i386/usr/libexec/elf/ld: warning: libz.so.2, : needed by /usr/obj/alpha/usr/src/i386/usr/lib/libssh.so, not found : (try using -rpath or -rpath-link) But the library _is_ there, and it was built even earlier than libssh: : # cd /usr/obj/alpha/usr/src/i386/usr/lib : # ls -l libssh.so* libz.so* : lrwxr-xr-x 1 root wheel 11 Jan 25 06:19 libssh.so -> libssh.so.2 : -rwxr-xr-x 1 root wheel 295859 Jan 25 06:19 libssh.so.2 : lrwxr-xr-x 1 root wheel 9 Jan 25 06:34 libz.so -> libz.so.2 : -rwxr-xr-x 1 root wheel 80017 Jan 25 06:11 libz.so.2 Now about the bug. Here's the interesting output from both i386 and alpha versions of cross-compiler built tonight: : # /usr/obj/usr/src/i386/usr/bin/gcc -print-search-dirs : install: /usr/obj/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/ : libraries: /usr/obj/usr/src/i386/usr/libexec/:/usr/obj/usr/src/i386/usr/lib/ : # /usr/obj/alpha/usr/src/i386/usr/bin/gcc -print-search-dirs : install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/ : libraries: Note the empty "libraries:" for the alpha version. I think this is the bug. I will see if I can fix this bug myself, but I thought David could fix it quicker than me. :-) Cheers, -- Ruslan Ermilov Oracle Developer/DBA, [EMAIL PROTECTED] Sunbay Software AG, [EMAIL PROTECTED] FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age
Index: secure/lib/libssh/Makefile =================================================================== RCS file: /home/ncvs/src/secure/lib/libssh/Makefile,v retrieving revision 1.12 diff -u -r1.12 Makefile --- secure/lib/libssh/Makefile 2002/01/23 15:54:09 1.12 +++ secure/lib/libssh/Makefile 2002/01/25 08:16:18 @@ -24,6 +24,9 @@ CFLAGS+= -DKRB5 .endif # MAKE_KERBEROS5 +DPADD= ${LIBCRYPTO} ${LIBZ} +LDADD= -lcrypto -lz + .include <bsd.lib.mk> .PATH: ${SSHDIR} ${SSHDIR}/lib Index: secure/libexec/sftp-server/Makefile =================================================================== RCS file: /home/ncvs/src/secure/libexec/sftp-server/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- secure/libexec/sftp-server/Makefile 2002/01/23 15:54:09 1.4 +++ secure/libexec/sftp-server/Makefile 2002/01/25 08:16:18 @@ -5,8 +5,8 @@ SRCS= sftp-server.c sftp-common.c MAN= sftp-server.8 -LDADD+= -lssh -lcrypto -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBZ} +LDADD+= -lssh -lcrypto +DPADD+= ${LIBSSH} ${LIBCRYPTO} .include <bsd.prog.mk> Index: secure/usr.bin/scp/Makefile =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/scp/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- secure/usr.bin/scp/Makefile 2002/01/23 15:54:10 1.6 +++ secure/usr.bin/scp/Makefile 2002/01/25 08:16:18 @@ -4,8 +4,8 @@ PROG= scp SRCS= scp.c scp-common.c -LDADD+= -lssh -lcrypto -lutil -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ} +DPADD= ${LIBSSH} +LDADD= -lssh .include <bsd.prog.mk> Index: secure/usr.bin/sftp/Makefile =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/sftp/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- secure/usr.bin/sftp/Makefile 2002/01/23 15:54:10 1.2 +++ secure/usr.bin/sftp/Makefile 2002/01/25 08:16:18 @@ -4,8 +4,8 @@ PROG= sftp SRCS= sftp.c sftp-client.c sftp-int.c sftp-common.c sftp-glob.c scp-common.c -LDADD+= -lssh -lcrypto -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBZ} +LDADD= -lssh -lcrypto +DPADD= ${LIBSSH} ${LIBCRYPTO} .include <bsd.prog.mk> Index: secure/usr.bin/ssh-add/Makefile =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/ssh-add/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- secure/usr.bin/ssh-add/Makefile 2002/01/23 15:54:14 1.6 +++ secure/usr.bin/ssh-add/Makefile 2002/01/25 08:16:18 @@ -4,8 +4,8 @@ PROG= ssh-add SRCS= ssh-add.c -LDADD+= -lssh -lcrypto -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBZ} +LDADD+= -lssh -lcrypto +DPADD+= ${LIBSSH} ${LIBCRYPTO} .include <bsd.prog.mk> Index: secure/usr.bin/ssh-agent/Makefile =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/ssh-agent/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- secure/usr.bin/ssh-agent/Makefile 2002/01/23 15:54:14 1.6 +++ secure/usr.bin/ssh-agent/Makefile 2002/01/25 08:16:18 @@ -4,8 +4,8 @@ PROG= ssh-agent SRCS= ssh-agent.c -LDADD+= -lssh -lcrypto -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBZ} +LDADD+= -lssh -lcrypto +DPADD+= ${LIBSSH} ${LIBCRYPTO} .include <bsd.prog.mk> Index: secure/usr.bin/ssh-keygen/Makefile =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/ssh-keygen/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- secure/usr.bin/ssh-keygen/Makefile 2002/01/23 15:54:17 1.7 +++ secure/usr.bin/ssh-keygen/Makefile 2002/01/25 08:16:18 @@ -4,8 +4,8 @@ PROG= ssh-keygen SRCS= ssh-keygen.c -LDADD+= -lssh -lcrypto -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBZ} +LDADD+= -lssh -lcrypto +DPADD+= ${LIBSSH} ${LIBCRYPTO} .include <bsd.prog.mk> Index: secure/usr.bin/ssh-keyscan/Makefile =================================================================== RCS file: /home/ncvs/src/secure/usr.bin/ssh-keyscan/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- secure/usr.bin/ssh-keyscan/Makefile 2002/01/23 15:54:17 1.2 +++ secure/usr.bin/ssh-keyscan/Makefile 2002/01/25 08:16:18 @@ -4,8 +4,8 @@ PROG= ssh-keyscan SRCS= ssh-keyscan.c -LDADD+= -lssh -lcrypto -lz -DPADD+= ${LIBSSH} ${LIBCRYPTO} ${LIBZ} +LDADD+= -lssh -lcrypto +DPADD+= ${LIBSSH} ${LIBCRYPTO} .include <bsd.prog.mk> Index: lib/libpam/modules/pam_ssh/Makefile =================================================================== RCS file: /home/ncvs/src/lib/libpam/modules/pam_ssh/Makefile,v retrieving revision 1.8 diff -u -r1.8 Makefile --- lib/libpam/modules/pam_ssh/Makefile 2002/01/23 15:54:08 1.8 +++ lib/libpam/modules/pam_ssh/Makefile 2002/01/25 08:16:18 @@ -7,8 +7,8 @@ SHLIB_NAME= pam_ssh.so SRCS= pam_ssh.c CFLAGS+= -I${SSHSRC} -DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} ${LIBUTIL} ${LIBZ} -LDADD= -lssh -lcrypto -lcrypt -lutil -lz +DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} ${LIBUTIL} +LDADD= -lssh -lcrypto -lcrypt -lutil MAN= pam_ssh.8 .include <bsd.lib.mk>
Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.235 diff -u -r1.235 Makefile.inc1 --- Makefile.inc1 2001/12/28 11:53:18 1.235 +++ Makefile.inc1 2002/01/25 08:22:50 @@ -731,6 +731,7 @@ # librpcsvc libtacplus libutil libz libssh # libradius: libmd # libreadline: libncurses +# libssh: libcrypto libz # libstc++: msun # libtacplus: libmd # @@ -740,7 +741,7 @@ # kerberosIV/lib kerberos5/lib: lib/libcrypt # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb \ # secure/lib/libssh lib/libz -# secure/lib: lib/libmd +# secure/lib: secure/lib/libcrypto lib/libmd lib/libz # .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc) _csu= lib/csu/${MACHINE_ARCH}.pcc @@ -750,8 +751,11 @@ _csu= lib/csu/${MACHINE_ARCH} .endif -.if !defined(NOSECURE) && !defined(NOCRYPT) +.if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE) _secure_lib= secure/lib +.if exists(${.CURDIR}/secure/lib/libcrypto) +_libcrypto= secure/lib/libcrypto +.endif .endif .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4) @@ -772,10 +776,10 @@ libraries: .for _lib in ${_csu} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt \ - ${_secure_lib} ${_kerberosIV_lib} \ + lib/libz ${_libcrypto} ${_secure_lib} ${_kerberosIV_lib} \ ${_kerberos5_lib} lib/libcom_err lib/libkvm lib/msun lib/libncurses \ lib/libopie lib/libradius lib/librpcsvc lib/libsbuf lib/libtacplus \ - lib/libutil lib/libz lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap} + lib/libutil lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap} .if exists(${.CURDIR}/${_lib}) cd ${.CURDIR}/${_lib}; \ ${MAKE} depend; \