summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-02-22 11:33:36 -0500
committerAndy Schwerin <schwerin@10gen.com>2013-02-22 13:35:39 -0500
commit0c1895dae4a9cd6550f8ce0a8c40fe4d988361d5 (patch)
tree14123a50e3d99e600804655a6af612d171f86215
parent03f150d60037e1206a6ed3b001c33118c7e17dbc (diff)
downloadmongo-0c1895dae4a9cd6550f8ce0a8c40fe4d988361d5.tar.gz
SCons: Make glibc check a function of --release flag, not presence of --s3dist on command line.
Release builds of mongo on Linux are not supposed to depend on symbols from GLIBC2.4. Prior to this patch, we enforced this by adding a post build option to Program steps on linux when s3dist appeared on the command line, unless suppressed by --no-glibc-check. In this patch, we instead add the post build option if --release is set on the command line, unless suppressed by the --no-glibc-check. Without this change, the s3dist rule can cause unnecessary relinking of the programs to be archived and pushed.
-rw-r--r--SConstruct3
-rw-r--r--src/mongo/SConscript8
2 files changed, 9 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 1bea6d7d7fc..219f270cb5e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -904,6 +904,8 @@ elif not onlyServer:
if windows:
shellEnv.Append( LIBS=["winmm.lib"] )
+enforce_glibc = linux and has_option("release") and not has_option("no-glibc-check")
+
def checkErrorCodes():
import buildscripts.errorcodes as x
if x.checkErrorCodes() == False:
@@ -1129,6 +1131,7 @@ Export("usesm usev8")
Export("darwin windows solaris linux freebsd nix")
Export('module_sconscripts')
Export("debugBuild")
+Export("enforce_glibc")
env.SConscript('src/SConscript', variant_dir='$BUILD_DIR', duplicate=False)
env.SConscript('src/SConscript.client', variant_dir='$BUILD_DIR/client_build', duplicate=False)
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index 50a0d28cf49..9335eaa39a2 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -12,6 +12,7 @@ Import("testEnv")
Import("has_option")
Import("usesm usev8")
Import("installSetup")
+Import("enforce_glibc")
Import("darwin windows solaris linux nix")
env.SConscript(['base/SConscript',
@@ -742,11 +743,14 @@ if shellEnv is not None:
def checkGlibc(target,source,env):
import subprocess
+ import SCons.Errors
stringProcess = subprocess.Popen( [ "strings", str( target[0] ) ], stdout=subprocess.PIPE )
stringResult = stringProcess.communicate()[0]
if stringResult.count( "GLIBC_2.4" ) > 0:
print( "************* " + str( target[0] ) + " has GLIBC_2.4 dependencies!" )
- Exit(-3)
+ raise SCons.Errors.BuildError(
+ node=target[0],
+ errstr="target has GLIBC_2.4 dependencies!")
distBinaries = []
@@ -758,7 +762,7 @@ def installBinary( e, name ):
name = add_exe( name )
- if (not has_option( "no-glibc-check" ) and linux and "s3dist" in COMMAND_LINE_TARGETS):
+ if enforce_glibc:
e.AddPostAction( name, checkGlibc )
if (solaris or linux) and (not has_option("nostrip")):