|
Re: [Q] on build a DLL from static shared objects
|
10/09/2009 2:00 AM
post39655
|
Re: [Q] on build a DLL from static shared objects
> 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?
Regards,
Daniel
|
|
|