[Scons-users] Workaround/support for -Wl,--whole-archive

Bill Deegan bill at baddogconsulting.com
Tue May 9 21:57:50 EDT 2017


Jay,

Plans for many enhancements.. Looking for more developers ;)

Clever hack!
Would you consider adding it to the wiki?

-Bill

On Tue, May 9, 2017 at 9:36 PM, Jay West <jhdub23 at gmail.com> wrote:

> Previous workarounds for scons lack of support for -Wl,--whole-archive was
> to use LINKFLAGS and manually add dependencies for all files listed in
> LINKFLAGS.  While this works, having to generate the LINKFLAGS and having
> to carefully manage the dependencies is a pain.
>
> Here is an alternate method.  Add the following to your scons file:
>
> whole_archive = env.Command('-Wl,--whole-archive', [], '')
> no_whole_archive = env.Command('-Wl,--no-whole-archive', [], '')
>
>
>
> Now you can wrap the necessary libraries with
> whole-archive/no-whole-archive in any combination. Example:
>
> so_libs = env.SharedLibrary('myso', whole_archive+['libfoo1.a']+
> no_whole_archive+['libbar.a']+whole_archive+['libfoo2.a']+
> no_whole_archive)
>
>
>
> Are there any plans for scons to support -Wl,--whole-archive natively?
>
> Jay
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170509/f1980ad6/attachment-0001.html>


More information about the Scons-users mailing list