Skip to content

Commit 8e2f173

Browse files
Merge pull request #10446 from etcwilde/ewilde/62-fix-float16-detection
[🍒6.2]: [compiler-rt] Fix detecting _Float16 support for secondary targets
2 parents f0041b4 + 147b985 commit 8e2f173

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,13 +848,18 @@ else ()
848848
if (CAN_TARGET_${arch})
849849
cmake_push_check_state()
850850
# TODO: we should probably make most of the checks in builtin-config depend on the target flags.
851-
message(STATUS "Performing additional configure checks with target flags: ${TARGET_${arch}_CFLAGS}")
852851
set(BUILTIN_CFLAGS_${arch} ${BUILTIN_CFLAGS})
853-
list(APPEND CMAKE_REQUIRED_FLAGS ${TARGET_${arch}_CFLAGS} ${BUILTIN_CFLAGS_${arch}})
852+
# CMAKE_REQUIRED_FLAGS must be a space separated string
853+
# Join BUILTIN_CFLAGS_${arch} and TARGET_${arch}_CFLAGS as a
854+
# space-separated string.
855+
list(APPEND CMAKE_REQUIRED_FLAGS
856+
${BUILTIN_CFLAGS_${arch}}
857+
${TARGET_${arch}_CFLAGS})
858+
list(JOIN CMAKE_REQUIRED_FLAGS " " CMAKE_REQUIRED_FLAGS)
859+
message(STATUS "Performing additional configure checks with target flags: ${CMAKE_REQUIRED_FLAGS}")
854860
# For ARM archs, exclude any VFP builtins if VFP is not supported
855861
if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
856-
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
857-
check_compile_definition(__ARM_FP "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
862+
check_compile_definition(__ARM_FP "${CMAKE_C_FLAGS}" COMPILER_RT_HAS_${arch}_VFP)
858863
if(NOT COMPILER_RT_HAS_${arch}_VFP)
859864
list(REMOVE_ITEM ${arch}_SOURCES ${arm_Thumb1_VFPv2_DP_SOURCES} ${arm_Thumb1_VFPv2_SP_SOURCES} ${arm_Thumb1_SjLj_EH_SOURCES})
860865
else()

0 commit comments

Comments
 (0)