llvm with tablegen backend for capstone disassembler
Go to file
Dan Liew bbde056b88 [CMake] Fix the value of config.target_cflags for non-macOS Apple platforms. Attempt #3.
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 third 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.

The second attempt (r363633) had to be reverted (r363779) due to a build
failure. The failed build was using a modified Apple toolchain where the iOS
simulator SDK was missing. This exposed a bug in the existing UBSan test
generation code where it was assumed that `COMPILER_RT_ENABLE_IOS` implied that
the toolchain supported both iOS and the iOS simulator. This is not true. This
has been fixed by using the list `SANITIZER_COMMON_SUPPORTED_OS` for the list
of supported Apple platforms for UBSan. For consistency with the other
Sanitizers we also now intersect the list of architectures with
UBSAN_SUPPORTED_ARCH.

rdar://problem/50124489

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

llvm-svn: 373405
2019-10-01 23:08:18 +00:00
clang [clang][OpenMP][NFC] #include GlobalDecl.h to avoid incomplete class type 2019-10-01 22:30:10 +00:00
clang-tools-extra [clang-tidy] Rename objc-avoid-spinlock check to darwin-avoid-spinlock 2019-10-01 21:18:40 +00:00
compiler-rt [CMake] Fix the value of config.target_cflags for non-macOS Apple platforms. Attempt #3. 2019-10-01 23:08:18 +00:00
debuginfo-tests
libc Add a director, along with README.txt and LICENSE.txt, for libc. 2019-09-16 21:39:08 +00:00
libclc travis: Add LLVM 9 build 2019-09-27 05:58:15 +00:00
libcxx Determine endianness at a time when it doesn't inadvertantly clear gdb's wrap_buffer via gdb.execute. 2019-10-01 22:42:37 +00:00
libcxxabi [libc++abi] Remove uses of C++ headers when possible 2019-10-01 18:43:02 +00:00
libunwind Unwind: avoid warning about unused typedef 2019-09-20 20:46:33 +00:00
lld Add missing REQUIRES: arm. 2019-10-01 17:35:56 +00:00
lldb [lldb] Fix unused variable warning 2019-10-01 22:04:14 +00:00
llgo
llvm AMDGPU: Fix an out of date assert in addressing FrameIndex 2019-10-01 23:07:14 +00:00
openmp [OpenMP] FreeBSD address check if mapped more native 2019-09-28 19:01:59 +00:00
parallel-libs
polly [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned) 2019-09-30 13:34:44 +00:00
pstl
.arcconfig
.clang-format
.clang-tidy
.git-blame-ignore-revs Add LLDB reformatting to .git-blame-ignore-revs 2019-09-04 09:31:55 +00:00
.gitignore
README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.