summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2017-05-25 09:37:12 -0400
committerAndrew Morrow <acm@mongodb.com>2017-05-25 12:12:50 -0400
commit41046adf0e53a35f7c2301f12d577476086c6c6d (patch)
treeedac398b71baf90aa3428b87b9c54fc4cd584f60 /SConstruct
parentd969e03747dc4587b5e0a2453014dd6be7e65f24 (diff)
downloadmongo-41046adf0e53a35f7c2301f12d577476086c6c6d.tar.gz
SERVER-27380 Revert "Revert "SERVER-27380 Re-enable the thin archive tool""
This reverts commit b4e14a64d7f51846e7c7ed94047ac545e26dce25.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct26
1 files changed, 19 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index 6222566afe7..61763fcc870 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1189,13 +1189,6 @@ env['BUILDERS']['LibraryObject'] = env['BUILDERS']['StaticObject']
if link_model.startswith("dynamic"):
- # Add in the abi linking tool if the user requested and it is
- # supported on this platform.
- if env.get('ABIDW'):
- abilink = Tool('abilink')
- if abilink.exists(env):
- abilink(env)
-
# Redirect the 'Library' target, which we always use instead of 'StaticLibrary' for things
# that can be built in either mode, to point to SharedLibrary.
env['BUILDERS']['Library'] = env['BUILDERS']['SharedLibrary']
@@ -1359,6 +1352,25 @@ if env['_LIBDEPS'] == '$_LIBDEPS_OBJS':
libdeps.setup_environment(env, emitting_shared=(link_model.startswith("dynamic")))
+# Both the abidw tool and the thin archive tool must be loaded after
+# libdeps, so that the scanners they inject can see the library
+# dependencies added by libdeps.
+if link_model.startswith("dynamic"):
+ # Add in the abi linking tool if the user requested and it is
+ # supported on this platform.
+ if env.get('ABIDW'):
+ abilink = Tool('abilink')
+ if abilink.exists(env):
+ abilink(env)
+
+if env['_LIBDEPS'] == '$_LIBDEPS_LIBS':
+ # The following platforms probably aren't using the binutils
+ # toolchain, or may be using it for the archiver but not the
+ # linker, and binutils currently is the olny thing that supports
+ # thin archives. Don't even try on those platforms.
+ if not env.TargetOSIs('solaris', 'darwin', 'windows'):
+ env.Tool('thin_archive')
+
if env.TargetOSIs('linux', 'freebsd', 'openbsd'):
env['LINK_LIBGROUP_START'] = '-Wl,--start-group'
env['LINK_LIBGROUP_END'] = '-Wl,--end-group'