[Scons-users] bug with SharedLibrary - scons-2.3.0 - cygwin ?

Patrick Wambacq patrick.wambacq at esat.kuleuven.be
Mon Jul 22 11:14:03 EDT 2013


Hi,

I see the following strange behavior with this minimalist SConstruct file containing just a single line:
SharedLibrary(target='foo',source=['foo.c'])


On cygwin with scons 2.3.0:

$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o foo.os -c foo.c
gcc -o cygfoo.dll -shared
gcc: fatal error: no input files
compilation terminated.
scons: *** [cygfoo.dll] Error 1
scons: building terminated because of errors.

On cygwin with scons 2.2.0:

$ ../scons_base/bin/scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o foo.os -c foo.c
gcc -o foo.dll -shared foo.os
scons: done building targets.

On Linux with scons 2.3.0:

% scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o foo.os -c -fPIC foo.c
gcc -o libfoo.so -shared foo.os
scons: done building targets.


If I use StaticLibrary, then everything works.
Some more debug info for the problematic case:

$ scons --debug=presub
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Building cygfoo.dll and foo.dll.a with action:
SharedFlagChecker(target, source, env)
Building cygfoo.dll and foo.dll.a with action:
VersionedSharedLibrary(target, source, env)
Building cygfoo.dll and foo.dll.a with action:
$SHLINK -o cygfoo.dll $SHLINKFLAGS $__RPATH
gcc -o cygfoo.dll -shared
gcc: fatal error: no input files
compilation terminated.
scons: *** [cygfoo.dll] Error 1
scons: building terminated because of errors.

So there is no $SOURCES argument for the linker pass
(notice that foo.os was already there when this command was issued - I had forgotten to remove it).

Notice also that with 2.2.0 the dll receives the name foo.dll whereas with 2.3.0 it becomes cygfoo.dll

Is this a bug?

Patrick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130722/43adb663/attachment.htm


More information about the Scons-users mailing list