From 8defe47507d3ad0fc17ad42e8d076a268f6716bb Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 2 Nov 2013 23:59:13 +0100 Subject: [PATCH] Debian/Policy 3.9.x : enforce strict dependencies on dynamic modules The recommendation is to use the link flag --no-undefined and to fed *all* dependencies to the respective link step. This changeset enables this strict linking of dependencies. It turned out that our dependencies were already sane (with the sole exception of a direct dependency to X-Lib in the XV viewer widget) --- admin/scons/Setup.py | 1 + src/SConscript | 10 +++++----- tests/SConscript | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py index ee09a3889..4fae9d85b 100644 --- a/admin/scons/Setup.py +++ b/admin/scons/Setup.py @@ -77,6 +77,7 @@ def defineBuildEnvironment(): , CXXFLAGS='-Wno-enum-compare' , CFLAGS='-std=gnu99' ) + env.Append(LINKFLAGS='-Wl,--no-undefined') # require every dependency is given on link, in the right order handleVerboseMessages(env) handleNoBugSwitches(env) diff --git a/src/SConscript b/src/SConscript index e6da9dbb9..8db741cfe 100644 --- a/src/SConscript +++ b/src/SConscript @@ -11,10 +11,10 @@ Import('env icons config') # define the source file/dirs comprising each artifact to be built. -lLib = env.SharedLibrary('lumierasupport', srcSubtree('lib'), install=True) -lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), install=True) -lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'), install=True) -lProc = env.SharedLibrary('lumieraproc', srcSubtree('proc'), install=True) +lLib = env.SharedLibrary('lumierasupport', srcSubtree('lib'), install=True) +lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), addLibs=lLib, install=True) +lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'),addLibs=lLib+lApp, install=True) +lProc = env.SharedLibrary('lumieraproc', srcSubtree('proc'), addLibs=lLib+lApp+lBack, install=True) core = lProc+lBack+lApp+lLib # in reverse dependency order support_lib = lLib @@ -37,7 +37,7 @@ plugins = [] # currently none # the Lumiera GTK GUI envGtk = env.Clone() -envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm']) +envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','x11','xext','sm']) envGtk.Append(LIBS=core) guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('gui'), install=True) diff --git a/tests/SConscript b/tests/SConscript index 80388a067..f8c0aa337 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -51,7 +51,7 @@ def testCases(env,dir): testlib = [] testClasses = list(scanSubtree(dir,['*.cpp'])) if testClasses: - testlib = sharedTestLibs[dir] = env.SharedLibrary('test-'+dir, testClasses) + testlib = sharedTestLibs[dir] = env.SharedLibrary('test-'+dir, testClasses, addLibs=core_lib) ### TICKET #938 : should be: addLibs=linkContext(dir)) # pick up standalone plain-C tests standaloneTests = list(scanSubtree(dir,['test-*.c'])) @@ -74,7 +74,7 @@ testrunner = env.Program("test-suite", ["testrunner.cpp"]+testLibs+core_lib) testsuite = ( testcases + testrunner - + createPlugins(env, 'plugin') + + createPlugins(env, 'plugin', addLibs=core_lib) + env.File(glob('*.tests')) # depend explicitly on the test definition files for test.sh + config )