[compiler-rt] r359394 - [CMake] Don't modify `FUZZER_SUPPORTED_ARCH` is place.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 28 02:44:53 PDT 2019


Author: delcypher
Date: Sun Apr 28 02:44:53 2019
New Revision: 359394

URL: http://llvm.org/viewvc/llvm-project?rev=359394&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/test/fuzzer/CMakeLists.txt

Modified: compiler-rt/trunk/test/fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/CMakeLists.txt?rev=359394&r1=359393&r2=359394&view=diff
==============================================================================
--- compiler-rt/trunk/test/fuzzer/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/fuzzer/CMakeLists.txt Sun Apr 28 02:44:53 2019
@@ -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)
 




More information about the llvm-commits mailing list