From 0710d51aaf2503cc0e564da11831921695b49d1c Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 4 Jan 2013 22:44:27 +0100 Subject: [PATCH] SCons: fix the remaining shared linking problems on Ubuntu-Precise Our libraries constitute a clear dependency hierarchy, we do not want circular dependencies. Declaring these dependencies while creating the shared libraries would allow strict checking by the linker; but unfortunately this also creates transitive depdendencies stored as DT_NEEDED tags. While basically this would be just fine, the resolution of $ORIGIN on gets confused in case of transitively defined library dependencies over multiple hops, especially in case when actually no symbol of this transitive dependency is used. Since these newer systems set the --as-needed switch for linking by default, these unnecessary DT_NEEDED entries will be purged from the executable, but of course not from the shared library causing the transitive dependencies. As a consequence, when loading the executable, the $ORIGIN resolution mechanism doesn't act on the dependencies recorded in the library, causing the shared loader to abort with an "unresolved dependency" So the resolution for these problems is not to use transitive dependencies on libraries intended to be found via $ORIGIN --- src/SConscript | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SConscript b/src/SConscript index de4d03a91..d84ea60d7 100644 --- a/src/SConscript +++ b/src/SConscript @@ -11,12 +11,12 @@ Import('env icons config') # define the source file/dirs comprising each artifact to be built. -lLib = env.SharedLibrary('lumiera', srcSubtree('lib'), install=True) -lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), install=True, LIBS=lLib) -lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'),install=True) -lProc = env.SharedLibrary('lumieraproc', srcSubtree('proc'), install=True) +lLib = env.SharedLibrary('lumiera', 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) -core = lLib+lApp+lBack+lProc +core = lProc+lBack+lApp+lLib # in reverse dependency order core_lib = core support_lib = lLib