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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 15:41:35 PDT 2023


phosek added a comment.

Scudo is used as a default system allocator on Android (it is also intended as the default allocator for LLVM libc) and it supports ARM32. @Chia-hungDuan do you know why this issue doesn't show up on Android?



================
Comment at: compiler-rt/lib/scudo/standalone/CMakeLists.txt:49
+  set(SCUDO_LINK_LIBS ${COMPILER_RT_UNWINDER_LINK_LIBS} dl)
+elseif(COMPILER_RT_HAS_GWP_ASAN AND "${LLVM_NATIVE_ARCH}" STREQUAL "ARM")
+  # On ARM, we must link against an unwind lib when GWPAsan is used, otherwise
----------------
I don't think this is the right condition. `LLVM_NATIVE_ARCH` defaults to host architecture where LLVM is being built, but that may be different from the architecture we're compiling compiler-rt for when cross-compiling.

We should likely be using `if (CAN_TARGET_arm)`. Should this apply to both `arm` and `armhf`?


================
Comment at: compiler-rt/lib/scudo/standalone/CMakeLists.txt:64
+    message(FATAL_ERROR
+            "COMPILER_RT_USE_LLVM_UNWINDER is false and libgcc_s/libgcc was not found")
+  endif()
----------------
I'd probably something like `No suitable unwinder library`.


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