summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-05-19 10:51:03 -0400
committerAndrew Morrow <acm@mongodb.com>2016-05-24 14:06:07 -0400
commit96841731d86f761dd8862ebed64d3f97e86b748c (patch)
tree6a493fca3b5b0b07e7078858b7de0c2698e2a032 /SConstruct
parente37e7d1180ccd41ef2af455f013ef8fb68c825cf (diff)
downloadmongo-96841731d86f761dd8862ebed64d3f97e86b748c.tar.gz
SERVER-24185 Enable read-only relocations for ELF platforms
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct8
1 files changed, 3 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index 18fb99baa7d..426b51bede5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1463,15 +1463,10 @@ if env.TargetOSIs('posix'):
# SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
# startup.
- #
- # TODO: Is it necessary to add to both linkflags and shlinkflags, or are LINKFLAGS
- # propagated to SHLINKFLAGS?
if env.TargetOSIs('osx'):
env.Append( LINKFLAGS=["-Wl,-bind_at_load"] )
- env.Append( SHLINKFLAGS=["-Wl,-bind_at_load"] )
else:
env.Append( LINKFLAGS=["-Wl,-z,now"] )
- env.Append( SHLINKFLAGS=["-Wl,-z,now"] )
env.Append( LINKFLAGS=["-rdynamic"] )
env.Append( LIBS=[] )
@@ -2199,6 +2194,9 @@ def doConfigure(myenv):
AddToLINKFLAGSIfSupported(myenv, "-Wl,-z,noexecstack")
AddToLINKFLAGSIfSupported(myenv, "-Wl,--warn-execstack")
+ # If possible with the current linker, mark relocations as read-only.
+ AddToLINKFLAGSIfSupported(myenv, "-Wl,-z,relro")
+
# Apply any link time optimization settings as selected by the 'lto' option.
if has_option('lto'):
if myenv.ToolchainIs('msvc'):