1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

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

(cherry picked from commit 5e041eee11)
This commit is contained in:
Ekaterina Vaartis
2023-01-15 01:18:00 +03:00
committed by Rémi Verschelde
parent 886cc22e9b
commit 8bc325d991
3 changed files with 32 additions and 19 deletions

View File

@@ -51,7 +51,6 @@ def get_flags():
def configure(env):
## Build type
if env["target"] == "release":
@@ -76,6 +75,11 @@ def configure(env):
env.Prepend(CCFLAGS=["-g3"])
env.Append(LINKFLAGS=["-rdynamic"])
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"])
## Architecture
is64 = sys.maxsize > 2**32