[compiler-rt] r215247 - [CMake] Determine which compiler-rt librariesare supported on
Alexey Samsonov
vonosmas at gmail.com
Mon Aug 18 12:58:42 PDT 2014
On Sat, Aug 16, 2014 at 2:33 PM, Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:
> 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.
>
Did the build work before the patch? I didn't change the try_compile
function, just moved it to separate file. What platform/arch are you
building for?
Your patch is probably ok, just making sure I understand the cause of the
breakage.
>
> 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.
>
>
>
--
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140818/11a74e93/attachment.html>
More information about the llvm-commits
mailing list