diff options
author | Azharuddin Mohammed <azharudd@codeaurora.org> | 2018-07-30 18:18:59 +0000 |
---|---|---|
committer | Azharuddin Mohammed <azharudd@codeaurora.org> | 2018-07-30 18:18:59 +0000 |
commit | 1c06b114805c7b7a5468a501ab874bf3fe5202f1 (patch) | |
tree | f5e3edb2f903e9c505ecca34ee4b946e7d3cfac4 | |
parent | 8a9847b189b05e3dcff81adc257c10050dd777e7 (diff) | |
download | compiler-rt-1c06b114805c7b7a5468a501ab874bf3fe5202f1.tar.gz |
[cmake] [ARM] Exclude any VFP builtins if VFP is not supported
Summary:
rL325492 disables FPU features when using soft floating point
(-mfloat-abi=soft), which is used internally when building for arm. This causes
errors with builtins that utililize VFP instructions.
With this change we check if VFP is enabled (by checking if the preprocessor
macro __VFP_FP__ is defined), and exclude such builtins if it is not enabled.
Reviewers: rengolin, samsonov, compnerd, smeenai, javed.absar, peter.smith
Reviewed By: peter.smith
Subscribers: delcypher, peter.smith, mgorny, kristof.beyls, chrib, llvm-commits
Differential Revision: https://reviews.llvm.org/D47217
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@338284 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/builtins/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt index 75ff66405..82332967b 100644 --- a/lib/builtins/CMakeLists.txt +++ b/lib/builtins/CMakeLists.txt @@ -567,6 +567,15 @@ else () set(_arch "arm") endif() + # For ARM archs, exclude any VFP builtins if VFP is not supported + if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") + string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") + check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) + if(NOT COMPILER_RT_HAS_${arch}_VFP) + list(REMOVE_ITEM ${arch}_SOURCES ${arm_Thumb1_VFPv2_SOURCES} ${arm_Thumb1_SjLj_EH_SOURCES}) + endif() + endif() + # Filter out generic versions of routines that are re-implemented in # architecture specific manner. This prevents multiple definitions of the # same symbols, making the symbol selection non-deterministic. |