[LCP]statically linking argtable and other libraries

Christopher Baus christopher at baus.net
Thu Jul 15 13:19:02 UTC 2004


> On Thu, 8 Jul 2004, Christopher Baus wrote:
>
>>
>> >
>> >   Does the -static come before or after the -largtable2?  ld args are
>> > context
>> > sensitive.  You may want to check the output of gcc -v to make sure
>> the
>> > linker
>> > (collect2) is getting -static before any -l's.
>> >
>> > 								- Steve
>> The problem is with libtool.  It seems to be removing the -static switch
>> from the link command.
>
>     I must say I don't fully understand your problem, but, when you speak
>     about libtool removing some args you expected to be transmitted to the
>     linker, I just remember having struggled with that and finished using
>     the "-Xlinker" switch which is usefull to force transmiting some
>     special flag to the linker.
>     my own case looked like that :
>     in some Makefile.am I had this line :
>
> libmylib_la_LDFLAGS = -version-info -Xlinker --export-all-symbols
>
>     and the switch "--export-all-symbols" was transmitted to te linker at
>     building the lib.
>
>     maybe this can help ?
>
Yes this is exactly the problem.  I pass the following the libtool:

-static -llibarg2 -lsomeotherlib

and libtool doesn't pass the -static to the linker.  I think the problem
is the libraries need to be built with libtool themselves.  The easy
solution as you say is to bypass libtool all together with the -W1 or
-Xlinker switch as you say.

Then the question is:  Why use libtool at all?


-- 
Christopher Baus
http://www.baus.net/


-- 
Christopher Baus
http://www.baus.net/




More information about the linuxCprogramming mailing list