[llvm] r310076 - Drop Windows support from libFuzzer tests.

George Karpenkov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 10:43:29 PDT 2017


Author: george.karpenkov
Date: Fri Aug  4 10:43:28 2017
New Revision: 310076

URL: http://llvm.org/viewvc/llvm-project?rev=310076&view=rev
Log:
Drop Windows support from libFuzzer tests.

Differential Revision: https://reviews.llvm.org/D36205

Modified:
    llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
    llvm/trunk/lib/Fuzzer/test/afl-driver-extra-stats.test
    llvm/trunk/lib/Fuzzer/test/afl-driver-stderr.test
    llvm/trunk/lib/Fuzzer/test/equivalence-signals.test
    llvm/trunk/lib/Fuzzer/test/equivalence.test
    llvm/trunk/lib/Fuzzer/test/lit.cfg
    llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in
    llvm/trunk/lib/Fuzzer/test/merge-posix.test
    llvm/trunk/lib/Fuzzer/test/ulimit.test

Modified: llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/CMakeLists.txt?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/CMakeLists.txt (original)
+++ llvm/trunk/lib/Fuzzer/test/CMakeLists.txt Fri Aug  4 10:43:28 2017
@@ -1,26 +1,5 @@
-if(MSVC)
-  # For tests use the CRT specified for release build
-  # (asan doesn't support MDd and MTd)
-  if ("${LLVM_USE_CRT_RELEASE}" STREQUAL "")
-    set(CRT_FLAG " /MD ")
-  else()
-    set(CRT_FLAG " /${LLVM_USE_CRT_RELEASE} ")
-  endif()
-  # In order to use the sanitizers in Windows, we need to link against many
-  # runtime libraries which will depend on the target being created
-  # (executable or dll) and the c runtime library used (MT/MD).
-  # By default, cmake uses link.exe for linking, which fails because we don't
-  # specify the appropiate dependencies.
-  # As we don't want to consider all of that possible situations which depends
-  # on the implementation of the compiler-rt, the simplest option is to change
-  # the rules for linking executables and shared libraries, using the compiler
-  # instead of link.exe. Clang will consider the sanitizer flags, and
-  # automatically provide the required libraries to the linker.
-  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> ${CMAKE_CXX_FLAGS} ${CRT_FLAG} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> /link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>")
-  set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} ${CRT_FLAG} /LD <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG> <TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> /link <LINK_FLAGS>")
-endif()
 
-if(APPLE OR MSVC)
+if(APPLE)
   # LeakSanitizer is not supported on OSX and Windows right now
   set(HAS_LSAN 0)
   message(WARNING "LeakSanitizer is not supported."
@@ -62,20 +41,11 @@ include_directories(..)
 # Note this is done after declaring all tests so we can inform lit if any tests
 # need to be disabled.
 ###############################################################################
-set(LIBFUZZER_POSIX 1)
-if (MSVC)
-  set(LIBFUZZER_POSIX 0)
-endif()
 
 # Use just-built Clang to compile/link tests on all platforms, except for
 # Windows where we need to use clang-cl instead.
-if(NOT MSVC)
-  set(LIBFUZZER_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
-  set(LIBFUZZER_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
-else()
-  set(LIBFUZZER_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe)
-  set(LIBFUZZER_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe)
-endif()
+set(LIBFUZZER_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+set(LIBFUZZER_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
 
 # LIT-based libFuzzer tests.
 configure_lit_site_cfg(
@@ -91,12 +61,6 @@ configure_lit_site_cfg(
 
 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
     ${CMAKE_CURRENT_BINARY_DIR}
-    DEPENDS LLVMFuzzer-Unittest
-    )
-
+    DEPENDS LLVMFuzzer-Unittest)
 
-# Don't add dependencies on Windows. The linker step would fail on Windows,
-# since cmake will use link.exe for linking and won't include compiler-rt libs.
-if(NOT MSVC)
-  add_dependencies(check-fuzzer LLVMFuzzer asan clang llvm-symbolizer FileCheck sancov not)
-endif()
+add_dependencies(check-fuzzer LLVMFuzzer asan clang llvm-symbolizer FileCheck sancov not)

Modified: llvm/trunk/lib/Fuzzer/test/afl-driver-extra-stats.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/afl-driver-extra-stats.test?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/afl-driver-extra-stats.test (original)
+++ llvm/trunk/lib/Fuzzer/test/afl-driver-extra-stats.test Fri Aug  4 10:43:28 2017
@@ -1,5 +1,3 @@
-REQUIRES: posix
-
 RUN: %no_fuzzer_cpp_compiler -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard %S/AFLDriverTest.cpp %S/../afl/afl_driver.cpp -o %t-AFLDriverTest
 
 ; Test that not specifying an extra stats file isn't broken.

Modified: llvm/trunk/lib/Fuzzer/test/afl-driver-stderr.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/afl-driver-stderr.test?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/afl-driver-stderr.test (original)
+++ llvm/trunk/lib/Fuzzer/test/afl-driver-stderr.test Fri Aug  4 10:43:28 2017
@@ -1,5 +1,3 @@
-REQUIRES: posix
-
 RUN: %no_fuzzer_cpp_compiler -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard %S/AFLDriverTest.cpp %S/../afl/afl_driver.cpp -o %t-AFLDriverTest
 
 ; Test that not specifying a stderr file isn't broken.

Modified: llvm/trunk/lib/Fuzzer/test/equivalence-signals.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/equivalence-signals.test?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/equivalence-signals.test (original)
+++ llvm/trunk/lib/Fuzzer/test/equivalence-signals.test Fri Aug  4 10:43:28 2017
@@ -1,4 +1,3 @@
-REQUIRES: posix
 # Run EquivalenceATest against itself with a small timeout
 # to stress the signal handling and ensure that shmem doesn't mind
 # the signals.

Modified: llvm/trunk/lib/Fuzzer/test/equivalence.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/equivalence.test?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/equivalence.test (original)
+++ llvm/trunk/lib/Fuzzer/test/equivalence.test Fri Aug  4 10:43:28 2017
@@ -1,4 +1,3 @@
-REQUIRES: posix
 RUN: %cpp_compiler %S/EquivalenceATest.cpp -o %t-LLVMFuzzer-EquivalenceATest
 RUN: %cpp_compiler %S/EquivalenceBTest.cpp -o %t-LLVMFuzzer-EquivalenceBTest
 

Modified: llvm/trunk/lib/Fuzzer/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/lit.cfg?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/lit.cfg (original)
+++ llvm/trunk/lib/Fuzzer/test/lit.cfg Fri Aug  4 10:43:28 2017
@@ -43,9 +43,6 @@ if sys.platform.startswith('win') or sys
 if sys.platform.startswith('darwin'):
   config.available_features.add('darwin')
 
-if config.is_posix:
-  config.available_features.add('posix')
-
 if sys.platform.startswith('linux'):
   # Note the value of ``sys.platform`` is not consistent
   # between python 2 and 3, hence the use of ``.startswith()``.

Modified: llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in (original)
+++ llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in Fri Aug  4 10:43:28 2017
@@ -1,7 +1,6 @@
 config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.has_lsan = True if @HAS_LSAN@ == 1 else False
-config.is_posix = @LIBFUZZER_POSIX@
 config.cpp_compiler = "@LIBFUZZER_TEST_CXX_COMPILER@"
 config.c_compiler = "@LIBFUZZER_TEST_COMPILER@"
 config.osx_sysroot = "@CMAKE_OSX_SYSROOT@"

Modified: llvm/trunk/lib/Fuzzer/test/merge-posix.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/merge-posix.test?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/merge-posix.test (original)
+++ llvm/trunk/lib/Fuzzer/test/merge-posix.test Fri Aug  4 10:43:28 2017
@@ -1,5 +1,3 @@
-REQUIRES: posix
-
 RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-LLVMFuzzer-FullCoverageSetTest
 
 RUN: rm -rf  %tmp/T1 %tmp/T2

Modified: llvm/trunk/lib/Fuzzer/test/ulimit.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/ulimit.test?rev=310076&r1=310075&r2=310076&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/ulimit.test (original)
+++ llvm/trunk/lib/Fuzzer/test/ulimit.test Fri Aug  4 10:43:28 2017
@@ -1,5 +1,3 @@
-REQUIRES: posix
-
 RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-LLVMFuzzer-SimpleTest
 RUN: ulimit -s 1000
 RUN: not %t-LLVMFuzzer-SimpleTest




More information about the llvm-commits mailing list