[PATCH] D142888: [compiler-rt] Fix building GWPASAN on ARM

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 00:51:33 PST 2023


phosek added a comment.

When libunwind is being built as part of the CMake build as is the case in your example (using `-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind"`), you want GWP-ASan to link against the libunwind target from the same build, but that's not guaranteed even if you remove `--unwindlib=none` because there's no explicit dependency in the generated build graph. In fact, removing `--unwindlib=none` is potentially incorrect because your build may accidentally pick up libunwind from the host.

A correct solution is to keep `--unwindlib=none`, and to manually link libunwind from the same build. That's the solution we also use for libc++, see https://github.com/llvm/llvm-project/blob/b2bf995c02a04fd7f453d6931b79ce5a51871489/compiler-rt/CMakeLists.txt#L600. You'll want to use the same pattern here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142888/new/

https://reviews.llvm.org/D142888



More information about the llvm-commits mailing list