[Scons-users] Change order of parameters in linker call
William Blevins
wblevins001 at gmail.com
Wed Aug 5 14:54:18 EDT 2015
Let me start off by saying that we are going around in circles because the
problem has not clearly been stated. Please read
http://catb.org/~esr/faqs/smart-questions.html for more information.
I use SCons for C++ (and several other languages) with GCC on RHEL5/RHEL6
and do not have this issue using SCons 2.3.0.
My linker statement looks like:
> gcc -o <library name here> -shared <list of object files here> <list of
> libdirs here> <list of libraries here>
This is the desired behavior per the original question.
If you would like to ask your question better, then please feel free to
provide more information.
V/R,
William
On Wed, Aug 5, 2015 at 12:44 PM, Dominic Binks <dominic.binks at thebinkles.net
> wrote:
> Sorry, but this is a bug.
>
> The GNU linker specifies man page states (in the description for
> --start-group archives --end-group):
>
> "Normally, an archive is searched only once in the order that it is
> specified on the command line. If a symbol in that archive is needed to
> resolve an undefined symbol referred to by an object in an archive that
> appears later on the command line, the linker would not be able to resolve
> that reference."
>
> And further on explains an impact of using the option:
>
> "Using this option has a significant performance cost. It is best to use
> it only when there are unavoidable circular references between two or more
> archives."
>
> Since the current SCons behaviour is implicitly relying on the start-group
> behaviour it will cause problems.
>
> I know that the MS Linker works differently but I think SCons should be
> fixed to place the referenced libraries after the referenced objects (since
> the whole point of referenced libraries is to resolve symbols in the
> referenced objects).
>
> Dominic
>
> On 05/08/2015 16:03, Gary Oberbrunner wrote:
>
>> You should be able to modify LINKCOM (and maybe SHLINKCOM) to reorder
>> the link line.
>>
>> On Wed, Aug 5, 2015 at 10:40 AM, Viktor Dick <viktordick86 at gmail.com
>> <mailto:viktordick86 at gmail.com>> wrote:
>>
>>
>> Hi,
>> I just now noticed that on ubuntu 14.04, the linker seems to have
>> problems with the way it is called by scons. In particular,
>>
>> g++ -o test test.o -L/usr/lib/x86_64-linux-gnu -lboost_system
>>
>> works while
>>
>> g++ -o test -L /usr/lib/x86_64-linux-gnu -lboost_system test.o
>>
>> throws linker errors. Unfortunately, the second way is the one that is
>> chosen by SCons by default when using the Program() builder.
>>
>> Is there a quick fix to tell scons to change the order of the
>> parameters
>> or do I have to write a complete builder for this?
>>
>> Regards,
>> Viktor
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org <mailto:Scons-users at scons.org>
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>>
>>
>> --
>> Gary
>>
>>
>> _______________________________________________
>> 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/20150805/95ce45f0/attachment.html>
More information about the Scons-users
mailing list