[PATCH] D92958: [gn build] Add symbol_level to adjust debug info level
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 16 16:22:16 PST 2020
thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.
lg with the `Zd` thing addressed. Thanks!
================
Comment at: llvm/utils/gn/build/BUILD.gn:99
+ } else if (symbol_level == 1) {
+ cflags += [ "/Zd" ]
+ }
----------------
I think you don't need this. As far as I know, `Zd` is a cl.exe-level option that causes it to pass /DEBUG to `link.exe` and does nothing else. But we don't invoke cl.exe for links, we invoke `link.exe` directly. `link.exe /debug` will produce enough symbol information to create symbolized backtraces, but not enough to have line numbers. So you can either do nothing for symbol_level=1 with cflags and just pass /debug to ldflags like we already do, or you could do `if (symbol_level == 1 && is_clang) cflags += -gline-tables-only` (or -g1, same thing) so that we get the same behavior on linux and windows at least with clang as host compiler.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92958/new/
https://reviews.llvm.org/D92958
More information about the llvm-commits
mailing list