Browse Source

Merge pull request #100270 from bruvzg/clang_dw4

[Windows] Use `dwarf-4` for clang builds on Windows.
Rémi Verschelde 8 months ago
parent
commit
234ed35f68
1 changed files with 4 additions and 1 deletions
  1. 4 1
      SConstruct

+ 4 - 1
SConstruct

@@ -737,7 +737,10 @@ if env.msvc:
 else:
 else:
     if env["debug_symbols"]:
     if env["debug_symbols"]:
         if env["platform"] == "windows":
         if env["platform"] == "windows":
-            env.Append(CCFLAGS=["-gdwarf-5"])
+            if methods.using_clang(env):
+                env.Append(CCFLAGS=["-gdwarf-4"])  # clang dwarf-5 symbols are broken on Windows.
+            else:
+                env.Append(CCFLAGS=["-gdwarf-5"])  # For gcc, only dwarf-5 symbols seem usable by libbacktrace.
         else:
         else:
             # Adding dwarf-4 explicitly makes stacktraces work with clang builds,
             # Adding dwarf-4 explicitly makes stacktraces work with clang builds,
             # otherwise addr2line doesn't understand them
             # otherwise addr2line doesn't understand them