From 2167a77f9f99a80e9739506b2779a41193187962 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 6 Mar 2020 14:38:07 -0800 Subject: [PATCH] [runtimes] When COMPILER_RT is enabled, consider SANITIZER prefixes Currently we passthrough CMake variables based on project prefix, i.e. LIBCXX_, LIBCXXABI_, LIBUNWIND_ and COMPILER_RT_. However, many compiler-rt flags start with SANITIZER_ rather than COMPILER_RT, so passthrough those as well. Differential Revision: https://reviews.llvm.org/D75773 --- runtimes/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 64b5a57a4dc..94dabb81484 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -333,6 +333,11 @@ else() # if this is included from LLVM's CMake string(REPLACE "-" "_" canon_name ${projName}) string(TOUPPER ${canon_name} canon_name) list(APPEND prefixes ${canon_name}) + # Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_, + # so when compiler-rt is enabled, consider both. + if(canon_name STREQUAL "COMPILER_RT") + list(APPEND prefixes SANITIZER) + endif() string(FIND ${projName} "lib" LIB_IDX) if(LIB_IDX EQUAL 0)