<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 16, 2014 at 2:33 PM, Andy Gibbs <span dir="ltr"><<a href="mailto:andyg1001@hotmail.co.uk" target="_blank">andyg1001@hotmail.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Saturday, August 09, 2014 12:01 AM, Alexey Samsonov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: samsonov<br>
Date: Fri Aug  8 17:01:20 2014<br>
New Revision: 215247<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=215247&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=215247&view=rev</a><br>
Log:<br>
[CMake] Determine which compiler-rt libraries are supported on<br>
a given platform in a top-level CMakeLists.txt to use it both<br>
in lib/ and in test/ subdirectories. Move architecture/platform<br>
checks to config-ix.<br>
</blockquote>
<br></div>
Unfortunately your patch breaks builds where special linker flags are used: "try_compile" fails since the user-specified linker flags are overridden.<br></blockquote><div><br></div><div>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?</div>
<div>Your patch is probably ok, just making sure I understand the cause of the breakage.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Suggested change (which fixes it for me):<br>
<br>
Index: projects/compiler-rt/<u></u>CMakeLists.txt<br>
==============================<u></u>==============================<u></u>======<br>
--- projects/compiler-rt/<u></u>CMakeLists.txt<br>
+++ projects/compiler-rt/<u></u>CMakeLists.txt<br>
@@ -204,11 +204,11 @@<br>
macro(test_target_arch arch)<div class=""><br>
  set(TARGET_${arch}_CFLAGS ${ARGN})<br></div><div class="">
  try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}<br></div><div class="">
              COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"<br></div><div class="">
              OUTPUT_VARIABLE TARGET_${arch}_OUTPUT<br>
-              CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:<u></u>STRING=${TARGET_${arch}_<u></u>CFLAGS}")<br></div>
+              CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:<u></u>STRING=${TARGET_${arch}_<u></u>CFLAGS} ${CMAKE_EXE_LINKER_FLAGS}")<br>
  if(${CAN_TARGET_${arch}})<div class="im HOEnZb"><br>
    list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})<br></div><div class="im HOEnZb">
  elseif("${COMPILER_RT_TEST_<u></u>TARGET_ARCH}" MATCHES "${arch}" OR<br></div><div class="im HOEnZb">
         "${arch}" STREQUAL "arm_android")<br></div><div class="HOEnZb"><div class="h5">
    # Bail out if we cannot target the architecture we plan to test.<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div>
</div></div>