summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAzharuddin Mohammed <azharudd@codeaurora.org>2018-05-24 18:53:16 +0000
committerAzharuddin Mohammed <azharudd@codeaurora.org>2018-05-24 18:53:16 +0000
commit2a10f5da5acb1b51d0a2ecf13dca0bf1de859db2 (patch)
treed7c5c7091f9f62716041535a81ecffb021e52e74 /cmake
parent521935db9de17ad08748fd050137ac83b7734835 (diff)
[cmake] [ARM] Check if VFP is supported before including any VFP builtins
Summary: rL325492 disables FPU features when using soft floating point (-mfloat-abi=soft), which is used internally when building for armv7. This causes errors with builtins that utililize VFP instructions. With this change we first check if VFP is enabled (by checking if the preprocessor macro __VFP_FP__ is defined) before including such builtins. Reviewers: rengolin, samsonov, compnerd, smeenai, javed.absar, peter.smith Reviewed By: peter.smith Subscribers: 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@333216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/builtin-config-ix.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake
index a5704e5fe..e3f132033 100644
--- a/cmake/builtin-config-ix.cmake
+++ b/cmake/builtin-config-ix.cmake
@@ -48,6 +48,12 @@ set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
include(CompilerRTUtils)
include(CompilerRTDarwinUtils)
+# If targeting ARM, check if VFP is supported.
+if(CAN_TARGET_arm)
+ string(REPLACE ";" " " _TARGET_arm_CFLAGS "${TARGET_arm_CFLAGS}")
+ check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_arm_CFLAGS}" COMPILER_RT_HAS_ARM_VFP)
+endif()
+
if(APPLE)
find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx)