[Scons-dev] Your advice wanted on issue #1742: TryLink() is too successful sometimes...

Dirk Bächle tshortik at gmx.de
Tue May 20 17:58:22 EDT 2014


Hi there,

I'd like to get a second opinion (and third, and...) on the following 
problem:

I'm currently debugging issue #1742 and found out why the TryLink() 
sometimes returns successful, although this shouldn't happen. In the 
given example

   env = Environment(tools = ['g++', 'gnulink'])
   printCC(env)
   config = env.Configure()
   print 'C++ toolchain', config.TryLink('int foo() {}', '.c')
   config.Finish()

the variable $CC is empty, since the gcc tool doesn't get loaded. But a 
"*.c" file gets compiled, so the smart_link() function returns "$CC" for 
"$SMARTLINK", which is also the definition of "$LINK".
Finally, the command

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

evaluates to

   -o ....

, and the leading "-" suppresses the actual return value of the spawn().


So we know what happens, but should we do something about it? Does this 
need to get documented somewhere, or would it be good to catch it 
somehow? I don't have a clear idea for the latter option...your comments 
are welcome.

Best regards,

Dirk



More information about the Scons-dev mailing list