[Scons-users] Change order of parameters in linker call

Dirk Bächle tshortik at gmx.de
Wed Aug 5 14:32:21 EDT 2015


Hi Viktor,
hi Dominic,

please, as others have already requested, provide an example showing how you call the Program Builder. Ideally, it would be a 
self-contained MWE in the form of an archive (SConstruct + sources, as *.TGZ for example) which demonstrates the problem that you 
experience.

@Dominic: The original post doesn't mention start-group/end-group at all, so I don't understand why you refer to the according 
passage in the GCC specs when claiming that it's a bug indeed.

@Viktor: The default definition of the LINKCOM variable is

   $LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS

, so the question has to be raised how you get the source "test.o" to appear last in your command line. Are you sure that you're 
*not* simply adding the required "-L... -l..." flags to LINKFLAGS directly, but are using LIBS and LIBPATH as you're supposed to do 
(see also the UserGuide, Appendix A "Construction Variables")?

Best regards,

Dirk

On 05.08.2015 16:40, Viktor Dick 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
>



More information about the Scons-users mailing list