summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-02 16:48:09 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-02 16:48:09 +0100
commit92b6991d2f209735666cbb0af42123174640b4c4 (patch)
tree1b12c5f53ada0ced6a365d6acedbf16c46570fe6
parent7bffdca41ccedd22eac831e916a02b890e90bb28 (diff)
parent01ae54615e62b7a0d23bab0869c1e34967b92eab (diff)
Merge pull request #69484 from akien-mga/scons-gcc-clang-strip-non-debug
SCons: Strip symbol table for builds with `debug_symbols=no`
-rw-r--r--SConstruct6
1 files changed, 6 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 6847a7c937..03043ee110 100644
--- a/SConstruct
+++ b/SConstruct
@@ -544,6 +544,12 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=["-g3"])
else:
env.Append(CCFLAGS=["-g2"])
+ else:
+ if methods.using_clang(env) and not methods.is_vanilla_clang(env):
+ # Apple Clang, its linker doesn't like -s.
+ env.Append(LINKFLAGS=["-Wl,-S", "-Wl,-x", "-Wl,-dead_strip"])
+ else:
+ env.Append(LINKFLAGS=["-s"])
if env["optimize"] == "speed":
env.Append(CCFLAGS=["-O3"])