From a0a70c53cc7a2b1f5bf4cfe48df7ca3b4a62a898 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Wed, 19 Jun 2019 16:25:46 -0400 Subject: [PATCH] SERVER-41827 Build GDB indexes for binaries when using ld.gold in dynamic mode --- SConstruct | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 024199d18d63..609388fb1ba3 100644 --- a/SConstruct +++ b/SConstruct @@ -2761,7 +2761,9 @@ def doConfigure(myenv): # because it is much faster. Don't use it if the user has already configured another linker # selection manually. if not any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']): - AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold') + if AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold'): + if link_model.startswith("dynamic"): + AddToLINKFLAGSIfSupported(myenv, '-Wl,--gdb-index') # Explicitly enable GNU build id's if the linker supports it. AddToLINKFLAGSIfSupported(myenv, '-Wl,--build-id')