summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2022-11-09 10:54:52 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-16 17:01:15 +0000
commit4c9932cffeeda2f250473d24d52cf4b8ac095c1d (patch)
tree54ed062bb9de7d11a0cb17fe50cd4df46ec2d4b5 /SConstruct
parentf6c50e0b5e59381e2bb309845206cdbeffa96654 (diff)
downloadmongo-4c9932cffeeda2f250473d24d52cf4b8ac095c1d.tar.gz
SERVER-71209 Prefer 64 bit dwarf to debug types sections
Also changes to `-g2` over `-ggdb` since our research has indicated that `-ggdb` has no effect in our builds.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct10
1 files changed, 6 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index 83d42997c8e..504611ada3d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2877,7 +2877,7 @@ if env.TargetOSIs('posix'):
env.Append(
CCFLAGS=[
"-fasynchronous-unwind-tables",
- "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
+ "-g2" if not env.TargetOSIs('emscripten') else "-g",
"-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
@@ -4336,12 +4336,14 @@ def doConfigure(myenv):
if link_model.startswith("dynamic"):
myenv.AddToLINKFLAGSIfSupported('-Wl,--gdb-index')
- if link_model != 'dynamic':
+ if myenv.AddToCCFLAGSIfSupported('-gdwarf64'):
+ myenv.AppendUnique(LINKFLAGS=['-gdwarf64'])
+ elif link_model != 'dynamic':
# This will create an extra section where debug types can be referred from,
# reducing other section sizes. This helps most with big static links as there
# will be lots of duplicate debug type info.
- myenv.AddToCCFLAGSIfSupported('-fdebug-types-section')
- myenv.AddToLINKFLAGSIfSupported('-fdebug-types-section')
+ if myenv.AddToCCFLAGSIfSupported('-fdebug-types-section'):
+ myenv.AppendUnique(LINKFLAGS=['-fdebug-types-section'])
# Our build is already parallel.
myenv.AddToLINKFLAGSIfSupported('-Wl,--no-threads')