--- Begin Message ---
Package: hydrogen
Version: 0.9.5-2
Severity: wishlist
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oneiric ubuntu-patch
the package hydrogen fails to build when using the linker flag --as-needed
This is caused by the libraries being placed before the objects which
need the symbols on the command line. So the library symbols are not
registered as needed.
Combined with the --no-copy-dt-needed flag, which is default in debian
now too, this causes missing linkage with libporttime
See the log ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/hydrogen/+bug/803182
Attached patch fixes this issue by using the correct scons variables for
libraries.
The static libhydrogen should not go in LIBS as it is an object file but
I am unfamiliar with scons so I don't know where it goes. So I prepended
it to LIBS to ensure the shared libraries are placed behind it on the
commandline.
Description: fix build with ld --as-needed
libraries must be added to LIBS instead of ldflags so they are
ordered correctly on the command line.
With ld --as-needed the object files must be before the libraries providing
the symbols they need.
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/hydrogen/+bug/803182
Author: Julian Taylor <jtaylor.deb...@googlemail.com>
Index: hydrogen-0.9.5/Sconstruct
===================================================================
--- hydrogen-0.9.5.orig/Sconstruct 2011-06-30 18:58:48.010629098 +0200
+++ hydrogen-0.9.5/Sconstruct 2011-06-30 18:59:14.640629115 +0200
@@ -44,6 +44,7 @@
includes = []
cppflags = []
ldflags = []
+ libs = []
env = Environment( options = opts )
@@ -92,10 +93,10 @@
includes.append( '/usr/local/include/jack' )
elif sys.platform[:6] == 'linux2':
- ldflags.append('-lpthread')
- ldflags.append('-lasound')
- ldflags.append('-lporttime')
- # ldflags.append('-lrubberband')
+ libs.append('-lpthread')
+ libs.append('-lasound')
+ libs.append('-lporttime')
+ # libs.append('-lrubberband')
elif sys.platform == "win32":
includes.append( '3rdparty\libsndfile-1_0_17' )
@@ -106,7 +107,7 @@
else:
raise Exception( "Platform '%s' not supported" % sys.platform )
- return (includes, cppflags, ldflags)
+ return (includes, cppflags, ldflags, libs)
@@ -175,7 +176,7 @@
def get_hydrogen_lib( opts ):
- includes, cppflags, ldflags = get_platform_flags( opts )
+ includes, cppflags, ldflags, libs = get_platform_flags( opts )
includes.append( "libs/hydrogen/include" )
@@ -185,7 +186,7 @@
#location of qt4.py
qt4ToolLocation="."
- env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags )
+ env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags, LIBS=libs )
env.EnableQt4Modules( ['QtCore', 'QtGui','QtXml'], debug=False)
env.CacheDir( "scons_cache" )
@@ -223,7 +224,7 @@
env.Alias(target="install", source=env.Install(dir= env['DESTDIR'] + env['prefix'] + '/share/hydrogen/' + dname, source= dir + "/" + file))
def get_hydrogen_gui( lib_hydrogen , opts ):
- includes, cppflags, ldflags = get_platform_flags( opts )
+ includes, cppflags, ldflags, libs = get_platform_flags( opts )
includes.append( "libs/hydrogen/include" )
includes.append( "gui/src/UI" )
@@ -231,7 +232,7 @@
#location of qt4.py
qt4ToolLocation="."
- env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags )
+ env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags, LIBS=libs )
if str(env['gui']) == "1":
env.EnableQt4Modules( ['QtCore', 'QtGui','QtNetwork','QtXml'], debug=False)
@@ -259,7 +260,7 @@
src = scanFiles( directory, ['*.cpp', '*.cc', '*.c' ], [ 'moc_'] )
- env.Append( LIBS = lib_hydrogen )
+ env.Prepend( LIBS = lib_hydrogen )
if sys.platform != "win32":
env.Append( LIBS = ["sndfile"] )
@@ -378,7 +379,7 @@
#get includes ( important if you compile on non-standard envorionments)
-includes, a , b = get_platform_flags( opts )
+includes, a , b, c = get_platform_flags( opts )
env = Environment(options = opts, CPPPATH = includes)
signature.asc
Description: OpenPGP digital signature
--- End Message ---