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

Bill Deegan bill at baddogconsulting.com
Wed May 10 23:51:00 EDT 2017


Jay,

Thanks!
Whenever you've got some time to spare, just raise your hand and we'll help
you get going.

-Bill

On Wed, May 10, 2017 at 2:17 AM, Jay West <jhdub23 at gmail.com> wrote:

> Yes, I'll add to the wiki.
>
> Would love to help out in developing, but am under the gun for a major
> project for work.  Maybe later in the year.
>
> Jay
>
> On Tue, May 9, 2017 at 6:57 PM Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
>> 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
>>>
>>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>
> _______________________________________________
> 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/20170510/148b6ef8/attachment.html>


More information about the Scons-users mailing list