Skip to content

Commit f2be102

Browse files
mstorsjoIanWood1
authored andcommitted
[compiler-rt] Detect arm hardfloat targets via __ARM_PCS_VFP (llvm#137175)
This makes sure that COMPILER_RT_ARMHF_TARGET is set properly for targets without a specific "armhf" target name, such as armv7 windows. This fixes the builtins test comparesf2_test.c on Windows on armv7.
1 parent 74a9fa3 commit f2be102

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ else ()
877877
# For ARM archs, exclude any VFP builtins if VFP is not supported
878878
if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
879879
check_compile_definition(__ARM_FP "${CMAKE_C_FLAGS}" COMPILER_RT_HAS_${arch}_VFP)
880+
check_compile_definition(__ARM_PCS_VFP "${CMAKE_C_FLAGS}" COMPILER_RT_HAS_${arch}_ARMHF)
880881
if(NOT COMPILER_RT_HAS_${arch}_VFP)
881882
list(REMOVE_ITEM ${arch}_SOURCES ${arm_Thumb1_VFPv2_DP_SOURCES} ${arm_Thumb1_VFPv2_SP_SOURCES} ${arm_Thumb1_SjLj_EH_SOURCES})
882883
else()
@@ -908,7 +909,7 @@ else ()
908909

909910
# Needed for clear_cache on debug mode, due to r7's usage in inline asm.
910911
# Release mode already sets it via -O2/3, Debug mode doesn't.
911-
if (${arch} STREQUAL "armhf")
912+
if (COMPILER_RT_HAS_${arch}_ARMHF)
912913
list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
913914
endif()
914915

0 commit comments

Comments
 (0)