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

Leandro Lupori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 06:47:16 PST 2023


luporl marked 5 inline comments as done.
luporl added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/CMakeLists.txt:57-59
+    list(APPEND SCUDO_LINK_LIBS "$<TARGET_LINKER_FILE:unwind_static>" dl)
+  elseif(LIBUNWIND_ENABLE_SHARED)
+    list(APPEND SCUDO_LINK_LIBS "$<TARGET_LINKER_FILE:unwind_shared>")
----------------
phosek wrote:
> This could be a single generator expression, see https://github.com/llvm/llvm-project/blob/4f4b2161ec3cc42890aa9a445588d5a9a67e9033/compiler-rt/CMakeLists.txt#L596. I'm also not sure if we should prefer static over shared library.
Right, now I'm using the same generator expression as that of `COMPILER_RT_UNWINDER_LINK_LIBS`, that prefers shared over static library.


================
Comment at: compiler-rt/lib/scudo/standalone/CMakeLists.txt:65
+
+append_list_if(SCUDO_UNWINDLIB_NONE --unwindlib=none SCUDO_LINK_FLAGS)
 
----------------
DavidSpickett wrote:
> Say we are on AArch64, COMPILER_RT_USE_LLVM_UNWINDER is set ON. That means we're using llvm's unwinder.
> 
> Then we check if SCUDO_UNWINDLIB_NONE is ON and let's say it is, what effect does `--unwindlib=none` have? Does that flag just prevent another unwind library being linked on top of the one that COMPILER_RT_USE_LLVM_UNWINDER already added?
By comparing the link commands issued by `clang++` with and without `--unwindlib=none`, yes, the only difference is that when `--unwindlib=none` is omitted the host's unwind library is also included.

When building with gcc in my test, `-lgcc_s` was the extra library linked. The resulting Scudo shared library then ended up with dependencies to both `libunwind` and `libgcc_s`.


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