summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEkaterina Vaartis <vaartis@kotobank.ch>2023-01-15 01:18:00 +0300
committerEkaterina Vaartis <vaartis@kotobank.ch>2023-01-15 02:48:33 +0300
commit5e041eee11e611bc2c89dd54b1dad28d0660f335 (patch)
tree8c2a3db14fbcc8f49e41b700a879b6c8a18ecbc1 /SConstruct
parentfcba87e696d58912838d8a4a6987b10efa28e78f (diff)
Alter linux debug stacktraces handling to support more environments
- Use -gdwarf-4 to support both LLVM and GCC when calling addr2line - Subtract position-independant execuable relocation when passing the address to addr2line
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct3
1 files changed, 3 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 1eb6c0adc8..705ef43b3d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -540,6 +540,9 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=["/Od"])
else:
if env["debug_symbols"]:
+ # Adding dwarf-4 explicitly makes stacktraces work with clang builds,
+ # otherwise addr2line doesn't understand them
+ env.Append(CCFLAGS=["-gdwarf-4"])
if env.dev_build:
env.Append(CCFLAGS=["-g3"])
else: