hgertges at provinzial-online.de
2002-Jan-08 11:42 UTC
Compile SSH static on Solaris 2.7 (64Bit)
I like to compile ssh-3.0.2 on Solaris 2.7 with 64 Bit support in static mode. But I get a fatal error. The compilation with shared libraries is working very fine. Does anyone has ideas to compile OpenSSH cleanly in static mode? gcc -static -Wall -Wpointer-arith -Wno-uninitialized -I. -I. -I/usr/local/include -DETCDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM =\"/usr/ssh/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT =\"/usr/ssh/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER =\"/usr/ssh/libexec/sftp-server\" -D_PATH_SSH_PIDDIR=\"/etc/ssh\" -DHAVE_CONFIG_H -c uidswap.c uidswap.c: In function `temporarily_use_uid': uidswap.c:56: warning: int format, uid_t arg (arg 2) uidswap.c:56: warning: int format, gid_t arg (arg 3) uidswap.c:56: warning: int format, uid_t arg (arg 4) ...... gcc -static -Wall -Wpointer-arith -Wno-uninitialized -I. -I. -I/usr/local/include -DETCDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM =\"/usr/ssh/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT =\"/usr/ssh/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER =\"/usr/ssh/libexec/sftp-server\" -D_PATH_SSH_PIDDIR=\"/etc/ssh\" -DHAVE_CONFIG_H -c sshconnect.c sshconnect.c: In function `ssh_login': sshconnect.c:868: warning: subscript has type `char' ..... gcc -o ssh ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o readconf.o clientloop.o -L. -Lopenbsd-compat/ -L/usr/local/lib -R/usr/local/lib -lssh -lopenbsd-compat -lz -lsocket -lcrypto Undefined first referenced symbol in file gethostbyname openbsd-compat//libopenbsd-compat.a(fake-getaddrinfo.o) (symbol belongs to implicit dependency /usr/lib/libnsl.so.1) gethostbyaddr openbsd-compat//libopenbsd-compat.a(fake-getnameinfo.o) (symbol belongs to implicit dependency /usr/lib/libnsl.so.1) ld: fatal: Symbol referencing errors. No output written to ssh collect2: ld returned 1 exit status
On Tue, Jan 08, 2002 at 12:42:37PM +0100, hgertges at provinzial-online.de wrote:> I like to compile ssh-3.0.2 on Solaris 2.7 with 64 Bit support in static > mode. But I get a fatal error. The compilation with shared libraries is > working very fine. Does anyone has ideas to compile OpenSSH cleanly in > static mode?Not possible. <http://www.science.uva.nl/pub/solaris/solaris2/Q6.24.html>, which is result number 7 for the Google search "static link solaris libnsl". /fc
Moin hgertges! hgertges at provinzial-online.de schrieb am Dienstag, den 08. Januar 2002:> I like to compile ssh-3.0.2 on Solaris 2.7 with 64 Bit support in > static mode. But I get a fatal error. The compilation with shared > libraries is working very fine. Does anyone has ideas to compile > OpenSSH cleanly in static mode?As pointed out, this is not possible. Not that easily anyway...there are many pro's and cons to this. Also see http://gcc.gnu.org/ml/gcc-help/2001-10/msg00303.html> gcc -o ssh ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o > readconf.o clientloop.o -L. -Lopenbsd-compat/ -L/usr/local/lib > -R/usr/local/lib -lssh -lopenbsd-compat -lz -lsocket -lcrypto > Undefined first referenced > symbol in file > gethostbyname > openbsd-compat//libopenbsd-compat.a(fake-getaddrinfo.o) (symbol belongs to > implicit dependency /usr/lib/libnsl.so.1) > gethostbyaddr > openbsd-compat//libopenbsd-compat.a(fake-getnameinfo.o) (symbol belongs to > implicit dependency /usr/lib/libnsl.so.1) > ld: fatal: Symbol referencing errors. No output written to ssh > collect2: ld returned 1 exit statusAdd -lnsl -lsocket here. It might break down the road though... -- Kevin Sindhu <kevin at tgivan dot com> Systems Engineer TGI Technologies Inc. 107 E 3rd Avenue Tel: (604) 872-6676 Ext 321 Vancouver V5T 1C7 Fax: (604) 872-6601 British Columbia, Canada