summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/fuzzer
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-06-19 09:09:39 +0000
committerHans Wennborg <hans@hanshq.net>2019-06-19 09:09:39 +0000
commit2cf990fa274dac4539168410afd9680a0fbaf234 (patch)
tree9c599fe65d87d8b071321748097b626eef014b4d /compiler-rt/test/fuzzer
parentcd31e7868b3ee0f73486141498fb71959d235b25 (diff)
downloadbcm5719-llvm-2cf990fa274dac4539168410afd9680a0fbaf234.tar.gz
bcm5719-llvm-2cf990fa274dac4539168410afd9680a0fbaf234.zip
Revert r363633 "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2."
This caused Chromium's clang package to stop building, see comment on https://reviews.llvm.org/D61242 for details. > Summary: > The main problem here is that `-*-version_min=` was not being passed to > the compiler when building test cases. This can cause problems when > testing on devices running older OSs because Clang would previously > assume the minimum deployment target is the the latest OS in the SDK > which could be much newer than what the device is running. > > Previously the generated value looked like this: > > `-arch arm64 -isysroot > <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` > > With this change it now looks like: > > `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot > <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` > > This mirrors the setting of `config.target_cflags` on macOS. > > This change is made for ASan, LibFuzzer, TSan, and UBSan. > > To implement this a new `get_test_cflags_for_apple_platform()` function > has been added that when given an Apple platform name and architecture > returns a string containing the C compiler flags to use when building > tests. This also calls a new helper function `is_valid_apple_platform()` > that validates Apple platform names. > > This is the second attempt at landing the patch. The first attempt (r359305) > had to be reverted (r359327) due to a buildbot failure. The problem was > that calling `get_test_cflags_for_apple_platform()` can trigger a CMake > error if the provided architecture is not supported by the current > CMake configuration. Previously, this could be triggered by passing > `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were > generating test configurations for a list of architectures without > checking if the relevant Sanitizer actually supported that architecture. > We now intersect the list of architectures for an Apple platform > with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer > name) to iterate through the correct list of architectures. > > rdar://problem/50124489 > > Reviewers: kubamracek, yln, vsk, juliehockett, phosek > > Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits > > Tags: #llvm, #sanitizers > > Differential Revision: https://reviews.llvm.org/D61242 llvm-svn: 363779
Diffstat (limited to 'compiler-rt/test/fuzzer')
-rw-r--r--compiler-rt/test/fuzzer/CMakeLists.txt11
1 files changed, 2 insertions, 9 deletions
diff --git a/compiler-rt/test/fuzzer/CMakeLists.txt b/compiler-rt/test/fuzzer/CMakeLists.txt
index 9acbfdd9c6d..8e9f12dd122 100644
--- a/compiler-rt/test/fuzzer/CMakeLists.txt
+++ b/compiler-rt/test/fuzzer/CMakeLists.txt
@@ -89,19 +89,12 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
endif()
if (APPLE)
- # FIXME(dliew): This logic should be refactored to the way UBSan Darwin
- # testing is done.
set(EXCLUDE_FROM_ALL ON)
- list_intersect(FUZZER_TEST_IOS_ARCHS FUZZER_SUPPORTED_ARCH DARWIN_ios_ARCHS)
- foreach(arch ${FUZZER_TEST_IOS_ARCHS})
+ foreach(arch ${DARWIN_ios_ARCHS})
set(LIBFUZZER_TEST_APPLE_PLATFORM "ios")
set(LIBFUZZER_TEST_TARGET_ARCH ${arch})
- get_test_cflags_for_apple_platform(
- "${LIBFUZZER_TEST_APPLE_PLATFORM}"
- "${LIBFUZZER_TEST_TARGET_ARCH}"
- LIBFUZZER_TEST_FLAGS
- )
+ set(LIBFUZZER_TEST_FLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
set(LIBFUZZER_TEST_CONFIG_SUFFIX "-${arch}-${LIBFUZZER_TEST_APPLE_PLATFORM}")
string(TOUPPER ${arch} ARCH_UPPER_CASE)
set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
OpenPOWER on IntegriCloud