Index: cmake/builtin-config-ix.cmake =================================================================== --- cmake/builtin-config-ix.cmake +++ cmake/builtin-config-ix.cmake @@ -47,6 +47,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: lib/builtins/CMakeLists.txt =================================================================== --- lib/builtins/CMakeLists.txt +++ 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