[Scons-users] version 2.5.0 and SHLIBVERSIONFLAGS

Paweł Tomulik ptomulik at meil.pw.edu.pl
Tue May 10 20:23:44 EDT 2016


W dniu 11.05.2016 o 01:47, Paweł Tomulik pisze:
> W dniu 10.05.2016 o 23:30, Tim Jenness pisze:
>> I have a scons package that breaks badly in v2.5.0 on Linux because scons started adding $SHLIBVERSIONFLAGS (which really means “-Wl,Bsymbolic” is added to the g++ link line) to my LoadableModule targets (which happen to be SWIG generated files). I’m definitely not setting SHLIBVERSION and SharedLibraryModule doesn’t have the problem. Is it possible that there is a problem with LoadableModule not correctly working out that there is no shared library version defined? If I clear SHLIBVERSIONFLAGS in my SConstruct file the build works as before.
>>
>> Should I file a ticket on this? Am I setting a SHLIBVERSION specifically for LoadableModule without realising it?
>>
>>>> Tim Jenness
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
> 
> I can confirm, it's the case :(
> 
> The minimal example:
> 
> # Sconstruct
> env = Environment()
> env.LoadableModule('foo', 'foo.c')
> 
> 
> The issue exists because env['LDMODULEVERSION'] is initially set to
> "$SHLIBVERSION" (non-empty string), but this (non empty string
> '$SHLIBVERSION') is not correctly handled by a function called
> __libversionflags in SCons/Defaults.py (the variable is not
> substituted). This is a bug, but fixing it shouldn't be hard.
> 
> 
> A quick workaround may consist of overwritting env['__libversionflags']
> as follows:
> 
> 
> def __libversionflags(env, version_var, flags_var):
>   try:
>     if env.subst('$'+version_var):
>       return env[flags_var]
>   except KeyError:
>     pass
>   return None
> 
> env = Environment(__libversionflags = __libversionflags)
> env.LoadableModule('foo', 'foo.c')
> 
> 
> Similar fixed implementation of __libversionflags should go to
> Defaults.py to fix the bug.
> 
> Best regards!
> 

Just for reference:

https://bitbucket.org/scons/scons/pull-requests/319/fixed-issue-with-_xxxxxxversionflags

-- 
Pawel Tomulik


More information about the Scons-users mailing list