[compiler-rt] r334144 - [Fuzzer] Use private libc++ even for Fuchsia
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 6 15:59:14 PDT 2018
Author: phosek
Date: Wed Jun 6 15:59:14 2018
New Revision: 334144
URL: http://llvm.org/viewvc/llvm-project?rev=334144&view=rev
Log:
[Fuzzer] Use private libc++ even for Fuchsia
On Fuchsia, we use libc++ compiled with ASan for our ASan built
executable which means we cannot use the same libc++ for libFuzzer when
building fuzz targets, instead we'll link a custom internal libc++ into
Fuchsia's build of libFuzzer like we already do on Linux.
Differential Revision: https://reviews.llvm.org/D47835
Modified:
compiler-rt/trunk/lib/fuzzer/CMakeLists.txt
Modified: compiler-rt/trunk/lib/fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/CMakeLists.txt?rev=334144&r1=334143&r2=334144&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/fuzzer/CMakeLists.txt Wed Jun 6 15:59:14 2018
@@ -34,7 +34,7 @@ CHECK_CXX_SOURCE_COMPILES("
set(LIBFUZZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
+if(OS_NAME MATCHES "Linux|Fuchsia" AND COMPILER_RT_LIBCXX_PATH)
list(APPEND LIBFUZZER_CFLAGS -nostdinc++ -D_LIBCPP_ABI_VERSION=Fuzzer)
# Remove -stdlib= which is unused when passing -nostdinc++.
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
@@ -82,7 +82,7 @@ add_compiler_rt_runtime(clang_rt.fuzzer_
CFLAGS ${LIBFUZZER_CFLAGS}
PARENT_TARGET fuzzer)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
+if(OS_NAME MATCHES "Linux|Fuchsia" AND COMPILER_RT_LIBCXX_PATH)
macro(partially_link_libcxx name dir arch)
set(cxx_${arch}_merge_dir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${arch}_merge.dir")
file(MAKE_DIRECTORY ${cxx_${arch}_merge_dir})
@@ -114,11 +114,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linu
partially_link_libcxx(fuzzer_no_main ${LIBCXX_${arch}_PREFIX} ${arch})
partially_link_libcxx(fuzzer ${LIBCXX_${arch}_PREFIX} ${arch})
endforeach()
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia" AND HAVE_LIBCXX)
- foreach(arch ${FUZZER_SUPPORTED_ARCH})
- add_dependencies(RTfuzzer.${arch} cxx)
- add_dependencies(RTfuzzer_main.${arch} cxx)
- endforeach()
endif()
if(COMPILER_RT_INCLUDE_TESTS)
More information about the llvm-commits
mailing list