summaryrefslogtreecommitdiff
path: root/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r--compiler-rt/cmake/Modules/CompilerRTUtils.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 4c85551d7766..eefc466a4610 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -433,6 +433,25 @@ function(get_compiler_rt_target arch variable)
string(REGEX REPLACE "mipsisa64" "mipsisa32" triple_cpu_mips "${triple_cpu}")
string(REGEX REPLACE "mips64" "mips" triple_cpu_mips "${triple_cpu_mips}")
set(target "${triple_cpu_mips}${triple_suffix_gnu}")
+ elseif("${arch}" MATCHES "^arm")
+ # Arch is arm, armhf, armv6m (anything else would come from using
+ # COMPILER_RT_DEFAULT_TARGET_ONLY, which is checked above).
+ if (${arch} STREQUAL "armhf")
+ # If we are building for hard float but our ABI is soft float.
+ if ("${triple_suffix}" MATCHES ".*eabi$")
+ # Change "eabi" -> "eabihf"
+ set(triple_suffix "${triple_suffix}hf")
+ endif()
+ # ABI is already set in the triple, don't repeat it in the architecture.
+ set(arch "arm")
+ else ()
+ # If we are building for soft float, but the triple's ABI is hard float.
+ if ("${triple_suffix}" MATCHES ".*eabihf$")
+ # Change "eabihf" -> "eabi"
+ string(REGEX REPLACE "hf$" "" triple_suffix "${triple_suffix}")
+ endif()
+ endif()
+ set(target "${arch}${triple_suffix}")
else()
set(target "${arch}${triple_suffix}")
endif()