[PATCH] D47286: [libFuzzer] Run libFuzzer unit tests only on host architecture.
George Karpenkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 24 17:00:09 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT333241: [libFuzzer] Run libFuzzer unit tests only on host architecture. (authored by george.karpenkov, committed by ).
Herald added subscribers: Sanitizers, llvm-commits.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D47286
Files:
lib/fuzzer/tests/CMakeLists.txt
Index: lib/fuzzer/tests/CMakeLists.txt
===================================================================
--- lib/fuzzer/tests/CMakeLists.txt
+++ lib/fuzzer/tests/CMakeLists.txt
@@ -22,35 +22,36 @@
list(APPEND LIBFUZZER_UNITTEST_CFLAGS -nostdinc++ -D_LIBCPP_ABI_VERSION=Fuzzer)
endif()
-foreach(arch ${FUZZER_SUPPORTED_ARCH})
- set(LIBFUZZER_TEST_RUNTIME RTFuzzerTest.${arch})
- if(APPLE)
- set(LIBFUZZER_TEST_RUNTIME_OBJECTS
- $<TARGET_OBJECTS:RTfuzzer.osx>)
- else()
- set(LIBFUZZER_TEST_RUNTIME_OBJECTS
- $<TARGET_OBJECTS:RTfuzzer.${arch}>)
- endif()
- add_library(${LIBFUZZER_TEST_RUNTIME} STATIC
- ${LIBFUZZER_TEST_RUNTIME_OBJECTS})
- set_target_properties(${LIBFUZZER_TEST_RUNTIME} PROPERTIES
- ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- FOLDER "Compiler-RT Runtime tests")
-
- if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
- set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-build)
- set(LIBFUZZER_TEST_RUNTIME_CFLAGS -isystem ${COMPILER_RT_LIBCXX_PATH}/include)
- set(LIBFUZZER_TEST_RUNTIME_LINK_FLAGS ${LIBCXX_${arch}_PREFIX}/lib/libc++.a)
- endif()
-
- set(FuzzerTestObjects)
- generate_compiler_rt_tests(FuzzerTestObjects
- FuzzerUnitTests "Fuzzer-${arch}-Test" ${arch}
- SOURCES FuzzerUnittest.cpp ${COMPILER_RT_GTEST_SOURCE}
- RUNTIME ${LIBFUZZER_TEST_RUNTIME}
- DEPS gtest ${LIBFUZZER_TEST_RUNTIME_DEPS}
- CFLAGS ${LIBFUZZER_UNITTEST_CFLAGS} ${LIBFUZZER_TEST_RUNTIME_CFLAGS}
- LINK_FLAGS ${LIBFUZZER_UNITTEST_LINK_FLAGS} ${LIBFUZZER_TEST_RUNTIME_LINK_FLAGS})
- set_target_properties(FuzzerUnitTests PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-endforeach()
+# libFuzzer unit tests are only run on the host machine.
+set(arch "x86_64")
+
+set(LIBFUZZER_TEST_RUNTIME RTFuzzerTest.${arch})
+if(APPLE)
+ set(LIBFUZZER_TEST_RUNTIME_OBJECTS
+ $<TARGET_OBJECTS:RTfuzzer.osx>)
+else()
+ set(LIBFUZZER_TEST_RUNTIME_OBJECTS
+ $<TARGET_OBJECTS:RTfuzzer.${arch}>)
+endif()
+add_library(${LIBFUZZER_TEST_RUNTIME} STATIC
+ ${LIBFUZZER_TEST_RUNTIME_OBJECTS})
+set_target_properties(${LIBFUZZER_TEST_RUNTIME} PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ FOLDER "Compiler-RT Runtime tests")
+
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
+ set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-build)
+ set(LIBFUZZER_TEST_RUNTIME_CFLAGS -isystem ${COMPILER_RT_LIBCXX_PATH}/include)
+ set(LIBFUZZER_TEST_RUNTIME_LINK_FLAGS ${LIBCXX_${arch}_PREFIX}/lib/libc++.a)
+endif()
+
+set(FuzzerTestObjects)
+generate_compiler_rt_tests(FuzzerTestObjects
+ FuzzerUnitTests "Fuzzer-${arch}-Test" ${arch}
+ SOURCES FuzzerUnittest.cpp ${COMPILER_RT_GTEST_SOURCE}
+ RUNTIME ${LIBFUZZER_TEST_RUNTIME}
+ DEPS gtest ${LIBFUZZER_TEST_RUNTIME_DEPS}
+ CFLAGS ${LIBFUZZER_UNITTEST_CFLAGS} ${LIBFUZZER_TEST_RUNTIME_CFLAGS}
+ LINK_FLAGS ${LIBFUZZER_UNITTEST_LINK_FLAGS} ${LIBFUZZER_TEST_RUNTIME_LINK_FLAGS})
+set_target_properties(FuzzerUnitTests PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47286.148510.patch
Type: text/x-patch
Size: 3095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180525/4588033e/attachment.bin>
More information about the llvm-commits
mailing list