From 8651edf8985431c1d3f8dfb2b9309c02db5156b5 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sun, 28 Apr 2019 09:44:53 +0000 Subject: [PATCH] [CMake] Don't modify `FUZZER_SUPPORTED_ARCH` is place. On a Darwin host we were modifying the `FUZZER_SUPPORTED_ARCH` in place which would strip out non-x86 architectures. This unhelpful if we want to use `FUZZER_SUPPORTED_ARCH` later. To fix this we introduce `FUZZER_TEST_ARCH` which is similar to what we have for for the other sanitizers. For non-Darwin host platforms `FUZZER_TEST_ARCH` is the same as `FUZZER_SUPPORTED_ARCH` but for Darwin host platforms we use `darwin_filter_host_archs(...)` as the previous code did. llvm-svn: 359394 --- compiler-rt/test/fuzzer/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler-rt/test/fuzzer/CMakeLists.txt b/compiler-rt/test/fuzzer/CMakeLists.txt index ef46ec4a9061..d38ce478b6b9 100644 --- a/compiler-rt/test/fuzzer/CMakeLists.txt +++ b/compiler-rt/test/fuzzer/CMakeLists.txt @@ -12,8 +12,9 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) endif() endif() +set(FUZZER_TEST_ARCH ${FUZZER_SUPPORTED_ARCH}) if (APPLE) - darwin_filter_host_archs(FUZZER_SUPPORTED_ARCH FUZZER_SUPPORTED_ARCH) + darwin_filter_host_archs(FUZZER_SUPPORTED_ARCH FUZZER_TEST_ARCH) endif() if(COMPILER_RT_INCLUDE_TESTS) @@ -45,7 +46,7 @@ macro(test_fuzzer stdlib) string(REGEX REPLACE "^.(.*)" "${first_letter}\\1" part "${part}") set(STDLIB_CAPITALIZED "${STDLIB_CAPITALIZED}${part}") endforeach() - foreach(arch ${FUZZER_SUPPORTED_ARCH}) + foreach(arch ${FUZZER_TEST_ARCH}) set(LIBFUZZER_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER}) get_test_cc_for_arch(${arch} LIBFUZZER_TEST_COMPILER LIBFUZZER_TEST_FLAGS)