Ryan Mansfield(deleted)
|
Re: [Q] on build a DLL from static shared objects
|
Ryan Mansfield(deleted)
10/13/2009 1:39 PM
post39801
|
Re: [Q] on build a DLL from static shared objects
Daniel Weber wrote:
>> You can use force the entire archive into the shared object using
>> --whole-archive. Otherwise ld will only pull the required objects from
>> the archive.
>
> I did not know that flag, thanks. I also had to add --no-whole-archive after our own libs to avoid pulling in
everything else, too. It works on the command line if all archives are listed directly. But in our automated build, we
use a linker script file to provide the list of libraries (to avoid running into command line limits). These scripts
contain an INPUT command per archive.
> ==>
> This works fine:
> qcc ... -Wl,--whole-archive liboneS.a libtwoS.a -Wl,--no-whole-archive ...
>
> This doesn't:
> qcc ... -Wl,--whole-archive all_my_libs.txt -Wl,--no-whole-archive ...
> where all_my_libs.txt is something like
> INPUT(liboneS.a)
> INPUT(libtwoS.a)
>
> Should --whole-archive also affect the archives listed in the linker script (i.e. "is this a bug?")? Or is there
another command we could use in the script?
It's a bug. I've filed a PR and I have a fix for it. If you want I can
provide an experimental linker or you can submit a ticket and we can get
an official one to you.
Regards,
Ryan Mansfield
|
|
|