[ale] Compiling ssh

John Mills john at mills-atl.com
Thu Dec 28 17:43:32 EST 2000


Chris -

---- Chris Fowler <ChrisF at computone.com> wrote:
> I'm compiling ssh and want to include the functions in libssl that are only
> used in ssh.

I looked at the 'openssh' and 'openssl' directories which I built in RH6.2, and ran:
% ldd `which ssh` to identify libs used by 'ssh', giving:
libdl.so.-
libnsl.so.-
libz.so.-
libutil.so.-
libpam.so.-
libcrypto.so.-
libc.so.-
/lib/ld-linux.so.-

Only 'libcrypto.so-' comes from 'openssl', and '% ldd libcrypto.so.-' shows that it does _not_ entrain 
'libssl', so 'libssl' is a "red herring" here: the 'ssh' client doesn't seem to need it.

> I'm only using th ssh client and lib ssl is too big to include in an
> embedded environment.  Is there a commnad line option for gcc that will
> statically link libssl into ssh and only link those parts that are being
> used?  Not the parts that are not?

IIRC, building shared libs in 'openssl' required that I make the 'linux-shared' target, so perhaps you 
could build 'libcrypto.a'  in 'openssl' with '% make clean; make linux' and then build a version of 'ssh' 
linked to 'libcrypto.a'.

To do this, I would edit the 'LIBS' line in the 'openssh'  Makefile to link the static version of 'libcrypto' 
instead of the shared version, rename the old 'ssh' executable, and remake it. I expect the new 
version to be bigger, but not to depend on 'libcrypto' at run time - check that with 'ldd'.

'Openssh' also builds other utilities, some of which you might need.

I hope this generates enough more-expert comments and corrections that you can try it and see 
how you come out.

 - Mills
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list