[PATCH] D47217: [cmake] [ARM] Check if VFP is supported before including any VFP builtins

Azharuddin Mohammed via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 24 11:57:15 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL333216: [cmake] [ARM] Check if VFP is supported before including any VFP builtins (authored by azharudd, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D47217?vs=148270&id=148460#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D47217

Files:
  compiler-rt/trunk/cmake/builtin-config-ix.cmake
  compiler-rt/trunk/lib/builtins/CMakeLists.txt


Index: compiler-rt/trunk/cmake/builtin-config-ix.cmake
===================================================================
--- compiler-rt/trunk/cmake/builtin-config-ix.cmake
+++ compiler-rt/trunk/cmake/builtin-config-ix.cmake
@@ -48,6 +48,12 @@
 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)
Index: compiler-rt/trunk/lib/builtins/CMakeLists.txt
===================================================================
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt
@@ -394,11 +394,20 @@
   arm/unordsf2vfp.S)
 set(arm_Thumb1_icache_SOURCES
   arm/sync_synchronize.S)
-set(arm_Thumb1_SOURCES
-  ${arm_Thumb1_JT_SOURCES}
-  ${arm_Thumb1_SjLj_EH_SOURCES}
-  ${arm_Thumb1_VFPv2_SOURCES}
-  ${arm_Thumb1_icache_SOURCES})
+
+# If VFP is supported, include arm_Thumb1_SjLj_EH_SOURCES and
+# arm_Thumb1_VFPv2_SOURCES in arm_Thumb1_SOURCES.
+if(COMPILER_RT_HAS_ARM_VFP)
+  set(arm_Thumb1_SOURCES
+    ${arm_Thumb1_JT_SOURCES}
+    ${arm_Thumb1_SjLj_EH_SOURCES}
+    ${arm_Thumb1_VFPv2_SOURCES}
+    ${arm_Thumb1_icache_SOURCES})
+else()
+  set(arm_Thumb1_SOURCES
+    ${arm_Thumb1_JT_SOURCES}
+    ${arm_Thumb1_icache_SOURCES})
+endif()
 
 if(MINGW)
   set(arm_SOURCES


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47217.148460.patch
Type: text/x-patch
Size: 1538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180524/278e030c/attachment.bin>


More information about the llvm-commits mailing list