[PATCH] D109199: [compiler-rt][Fuchsia] Support building + running compiler-rt tests on fuchsia's host toolchain
Leonard Chan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 2 16:19:42 PDT 2021
leonardchan added a comment.
In D109199#2981174 <https://reviews.llvm.org/D109199#2981174>, @phosek wrote:
> @leonardchan would it be possible to break this up into 3 changes?
Can do.
================
Comment at: clang/cmake/caches/Fuchsia-stage2.cmake:123
set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
+ set(RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "")
+ set(RUNTIMES_${target}_COMPILER_RT_CAN_EXECUTE_TESTS ON CACHE BOOL "")
----------------
phosek wrote:
> This shouldn't be needed.
So while we do build builtins, this is actually needed to run builtins tests: https://github.com/llvm/llvm-project/blob/ad7e12226f6b1ebf91511899016cdfb29aa8919e/compiler-rt/test/CMakeLists.txt#L59
================
Comment at: clang/cmake/caches/Fuchsia-stage2.cmake:141
+ set(RUNTIMES_${target}_SANITIZER_COMMON_TEST_TARGET_CFLAGS "--unwindlib=libunwind -static-libgcc" CACHE STRING "")
+ set(RUNTIMES_${target}_TSAN_TEST_TARGET_CFLAGS "--unwindlib=libunwind" CACHE STRING "")
+ set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
----------------
phosek wrote:
> Don't we need the `-static-libgcc` flag here as well?
When testing locally, there was actually a tsan test that wasn't working if `-static-libgcc` was here. I can try to reproduce it. I believe it had to do with static linking in an archive, but a particular object file in that archive wasn't getting linked in which changed some runtime logic and caused the test to fail.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109199/new/
https://reviews.llvm.org/D109199
More information about the cfe-commits
mailing list