[compiler-rt] r215247 - [CMake] Determine which compiler-rt librariesare supported on
Andy Gibbs
andyg1001 at hotmail.co.uk
Sat Aug 16 14:33:31 PDT 2014
On Saturday, August 09, 2014 12:01 AM, Alexey Samsonov wrote:
> Author: samsonov
> Date: Fri Aug 8 17:01:20 2014
> New Revision: 215247
>
> URL: http://llvm.org/viewvc/llvm-project?rev=215247&view=rev
> Log:
> [CMake] Determine which compiler-rt libraries are supported on
> a given platform in a top-level CMakeLists.txt to use it both
> in lib/ and in test/ subdirectories. Move architecture/platform
> checks to config-ix.
Unfortunately your patch breaks builds where special linker flags are used:
"try_compile" fails since the user-specified linker flags are overridden.
Suggested change (which fixes it for me):
Index: projects/compiler-rt/CMakeLists.txt
==================================================================
--- projects/compiler-rt/CMakeLists.txt
+++ projects/compiler-rt/CMakeLists.txt
@@ -204,11 +204,11 @@
macro(test_target_arch arch)
set(TARGET_${arch}_CFLAGS ${ARGN})
try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"
OUTPUT_VARIABLE TARGET_${arch}_OUTPUT
- CMAKE_FLAGS
"-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_${arch}_CFLAGS}")
+ CMAKE_FLAGS
"-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_${arch}_CFLAGS}
${CMAKE_EXE_LINKER_FLAGS}")
if(${CAN_TARGET_${arch}})
list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "${arch}" OR
"${arch}" STREQUAL "arm_android")
# Bail out if we cannot target the architecture we plan to test.
More information about the llvm-commits
mailing list