-Wl,-z,defs doesn't work with sanitizers.
See https://clang.llvm.org/docs/AddressSanitizer.html
Details
- Reviewers
thakis - Commits
- rGb64fdaa86b5b: [gn build] Don't pass -Wl,-z,defs for sanitizer builds
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/utils/gn/build/BUILD.gn | ||
|---|---|---|
| 374 | Only on Linux (or non-win non-mac non-ios i guess. Maybe non-android non-fuchsia too, not sure there without looking it up) Also, do we need a separate config for this? Can we edit llvm/utils/gn/build/BUILD.gn around line 91 and put something like if (current_os != "ios" && current_os != "mac" && !(current_os == "linux" && (use_asan || use_tsan || use_ubsan))) {
ldflags += [ "-Wl,-z,defs" ]
}there? (Things only go in configs if some configs need to opt out of them, which here doesn't seem to be the case as far as I can tell.) | |
check current_os
| llvm/utils/gn/build/BUILD.gn | ||
|---|---|---|
| 374 | I initially did put it there, but that adds -Wl,-z,defs to static links as well, which doesn't change anything but makes the command line a bit longer. If that's fine with you though I can do that. | |
Only on Linux (or non-win non-mac non-ios i guess. Maybe non-android non-fuchsia too, not sure there without looking it up)
Also, do we need a separate config for this? Can we edit llvm/utils/gn/build/BUILD.gn around line 91 and put something like
if (current_os != "ios" && current_os != "mac" && !(current_os == "linux" && (use_asan || use_tsan || use_ubsan))) { ldflags += [ "-Wl,-z,defs" ] }there?
(Things only go in configs if some configs need to opt out of them, which here doesn't seem to be the case as far as I can tell.)