Operating System - HP-UX
1824216 Members
3582 Online
109669 Solutions
New Discussion юеВ

How to build statically linked executables.... (aka build OpenSSH 3.7.1p2)

 
Alzhy
Honored Contributor

How to build statically linked executables.... (aka build OpenSSH 3.7.1p2)

I'm trying to build OpenSSH 3.7.1p2... Already I am successful with compiling using gcc 3.3.1, the latest Zlib, tcpwrappers and OpenSSL installables from the HPUX Connect web site. I also created a depot form the built executables.. and installed on a different machne... When running ssh , it complains it is missing /usr/local/lib/libcrypto.sl.0.9.7 which is part of the SSL package which I have not installed thinking it will be compiled in...


My question, what compile directives (or link directive) should I use so that my SSH executables will no longer require Zlib, tcpwrappers and SSL libraries to be installed so it will run properly..?
Hakuna Matata.
3 REPLIES 3
Michael Steele_2
Honored Contributor

Re: How to build statically linked executables.... (aka build OpenSSH 3.7.1p2)

Refer to shared library objects, like in Solaris. In HP-UX there are only hard and soft links and a hard link is an inode.

And I would include /usr/local/lib/libcrypto.sl.0.9.7 in another way. Does this URL help?:

http://hpux.cict.fr/hppd/hpux/Networking/Admin/openssh-2.5.1p1/
Support Fatherhood - Stop Family Law
Alzhy
Honored Contributor

Re: How to build statically linked executables.... (aka build OpenSSH 3.7.1p2)

My question is is how do I build (gcc or ld directive?) so that an executable is "statically" linked. I think it means an executable will compile-in the necessary objects from an external library so it is totally independent and can stand alone (without that external library being installed first on a machine).

Hakuna Matata.
A. Clay Stephenson
Acclaimed Contributor

Re: How to build statically linked executables.... (aka build OpenSSH 3.7.1p2)

I'm not a big fan of gcc but the gcc option is -static (and possibly -static-libgcc). Man gcc for details.

Note: you may have to download the source for some libraries and create an archive (.a) library first.
If it ain't broke, I can fix that.