Jonathan McDowell <[EMAIL PROTECTED]> writes:

> I did various searches on the web last night to try and find some info
> about linking libraries. AFAICT the problem is that liblsh.a is formed
> from a bunch of object files and then libargp.a and so doesn't have the
> argp_* things properly linked in.
>
> The comp.unix.programmer FAQ (Section 6.2) suggests that to build static
> libraries out of other static libraries you should use the original
> object files.
>
> I've attached the output of a "make" on my system with a clean 0.1.20.
> Also the output of "./configure" in case that's of use.

> ar cru liblsh.a abstract_io.o abstract_crypto.o abstract_compress.o algorithms.o 
>alist.o arcfour.o atoms.o bignum.o blocking_write.o blowfish.o cascade.o cast.o cbc.o 
>channel.o channel_commands.o charset.o client.o client_keyexchange.o 
>client_password.o client_pty.o client_userauth.o combinators.o command.o compress.o 
>connection.o connection_commands.o daemon.o debug.o des.o digits.o disconnect.o dsa.o 
>dsa_keygen.o encrypt.o exception.o format.o gc.o hmac.o idea.o interact.o io.o 
>io_commands.o keyexchange.o list.o lookup_verifier.o md5.o packet_ignore.o pad.o 
>parse.o password.o proxy.o proxy_session.o proxy_userauth.o publickey_crypto.o 
>queue.o randomness.o read_data.o read_line.o read_packet.o reaper.o resource.o 
>server.o server_authorization.o server_keyexchange.o server_password.o 
>server_publickey.o server_pty.o server_session.o server_userauth.o sexp.o 
>sexp_commands.o sexp_parser.o sexp_streamed_parser.o sha.o service.o spki.o 
>spki_commands.o ssh1_fallback.o string_buffe!
!
r.o tcpforward.o tcpforward_commands.o translate_signal.o tty.o twofish.o unpad.o 
userauth.o werror.o write_buffer.o xalloc.o zlib.o memxor.o argp/libargp.a

You're right, that command is bogus (there might exist some ar or
linker program that can use ar-archives inside ar-archives, but it's
definitely not something one can expect to work. Expecting it to work
is somewhat like expecting tar to do strange things if a tar file is
included inside another tar file).

I thought that libargp.a was not used until at the final linking, say

  gcc  -g -O2 -ggdb3 -Wall -W  -Wmissing-prototypes -Wmissing-declarations 
-Wstrict-prototypes  -Waggregate-return  -Wpointer-arith -Wbad-function-cast 
-Wnested-externs  -o lsh  lsh.o liblsh.a symmetric/libsymmetric.a memxor.o 
argp/libargp.a -lutil -lnsl -lcrypt -lz -lgmp 

But apprearantly I changed that some time ago. I don't know what is
the best way to handle this; should object files that are needed on
some platforms but not others be included in liblsh.a, or linked into
the executables later?

/Niels

Reply via email to