forked from OSchip/llvm-project
[compiler-rt] Produce the right arch suffix for arm libraries
If producing libraries with an arch suffix (i.e. if
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR isn't set), we append the
architecture name. However, for arm, clang doesn't look for libraries
with the full architecture name, but only looks for "arm" and "armhf".
Try to deduce what the full target triple might have been, and use
that for deciding between "arm" and "armhf".
This tries to reapply this bit from D98173, that had to be reverted
in 7b153b43d3
due to affecting how
the builtins themselves are compiled, not only affecting the output
file name.
Differential Revision: https://reviews.llvm.org/D98452
This commit is contained in:
parent
26ec76add5
commit
8e11bede3a
|
@ -124,6 +124,21 @@ macro(set_output_name output name arch)
|
|||
else()
|
||||
if(ANDROID AND ${arch} STREQUAL "i386")
|
||||
set(${output} "${name}-i686${COMPILER_RT_OS_SUFFIX}")
|
||||
elseif("${arch}" MATCHES "^arm")
|
||||
if(COMPILER_RT_DEFAULT_TARGET_ONLY)
|
||||
set(triple "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
|
||||
else()
|
||||
set(triple "${TARGET_TRIPLE}")
|
||||
endif()
|
||||
# When using arch-suffixed runtime library names, clang only looks for
|
||||
# libraries named "arm" or "armhf", see getArchNameForCompilerRTLib in
|
||||
# clang. Therefore, try to inspect both the arch name and the triple
|
||||
# if it seems like we're building an armhf target.
|
||||
if ("${arch}" MATCHES "hf$" OR "${triple}" MATCHES "hf$")
|
||||
set(${output} "${name}-armhf${COMPILER_RT_OS_SUFFIX}")
|
||||
else()
|
||||
set(${output} "${name}-arm${COMPILER_RT_OS_SUFFIX}")
|
||||
endif()
|
||||
else()
|
||||
set(${output} "${name}-${arch}${COMPILER_RT_OS_SUFFIX}")
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue