Skip to content

Commit

Permalink
[compiler-rt] Fix detecting _Float16 support for secondary targets (#…
Browse files Browse the repository at this point in the history
…16479)

Cherry pick of
llvm/llvm-project@a4c8ef0,
we need this for building with GCC 13.

Co-authored-by: Alexander Richardson <[email protected]>
  • Loading branch information
sarnex and arichardson authored Dec 26, 2024
1 parent 788ff7f commit a9e29ed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,12 @@ else ()
if (CAN_TARGET_${arch})
cmake_push_check_state()
# TODO: we should probably make most of the checks in builtin-config depend on the target flags.
message(STATUS "Performing additional configure checks with target flags: ${TARGET_${arch}_CFLAGS}")
set(BUILTIN_CFLAGS_${arch} ${BUILTIN_CFLAGS})
list(APPEND CMAKE_REQUIRED_FLAGS ${TARGET_${arch}_CFLAGS} ${BUILTIN_CFLAGS_${arch}})
# CMAKE_REQUIRED_FLAGS must be a space separated string but unlike TARGET_${arch}_CFLAGS,
# BUILTIN_CFLAGS_${arch} is a CMake list, so we have to join it to create a valid command line.
list(JOIN BUILTIN_CFLAGS " " CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_FLAGS "${TARGET_${arch}_CFLAGS} ${BUILTIN_CFLAGS_${arch}}")
message(STATUS "Performing additional configure checks with target flags: ${CMAKE_REQUIRED_FLAGS}")
# For ARM archs, exclude any VFP builtins if VFP is not supported
if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em|armv8m.main|armv8.1m.main)$")
string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
Expand Down

0 comments on commit a9e29ed

Please sign in to comment.