[PATCH] D58951: [compiler-rt][tests] Improve handling with non-default toolchains

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 20:32:09 PST 2019


hubert.reinterpretcast created this revision.
hubert.reinterpretcast added reviewers: phosek, Hahnfeld, sfertile, nemanjai, jasonliu.
Herald added subscribers: Sanitizers, jdoerfert, delcypher, mgorny, dberris, kubamracek.
Herald added projects: LLVM, Sanitizers.

The compiler-rt tests build various components with varying compiler and
link flags while also using custom compile and link mechanisms.
When using a non-default toolchain for a "native compile", the tests do
not appear to respect `CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN`. This
could lead to link errors, etc. This patch attempts to address this by
building upon the current "cross compile" support associated with
`COMPILER_RT_TEST_COMPILER_CFLAGS` by adding a
`COMPILER_RT_TOOLCHAIN_CFLAGS`, which is
`COMPILER_RT_TEST_COMPILER_CFLAGS` should the latter be set and takes
`CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN` into account otherwise.

An issue encountered when preparing this change was that
`COMPILER_RT_UNITTEST_LINK_FLAGS` is dropped in many places, unlike
`COMPILER_RT_UNITTEST_CFLAGS`. This patch also attempts to remove that
inconsistency.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D58951

Files:
  cmake/Modules/AddCompilerRT.cmake
  cmake/base-config-ix.cmake
  cmake/config-ix.cmake
  lib/interception/tests/CMakeLists.txt
  lib/msan/tests/CMakeLists.txt
  lib/sanitizer_common/tests/CMakeLists.txt
  lib/scudo/standalone/tests/CMakeLists.txt
  lib/tsan/tests/CMakeLists.txt
  lib/xray/tests/CMakeLists.txt
  test/asan/CMakeLists.txt
  test/fuzzer/CMakeLists.txt
  test/lit.common.configured.in
  test/tsan/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58951.189273.patch
Type: text/x-patch
Size: 9111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190305/f4457520/attachment.bin>


More information about the llvm-commits mailing list