<div dir="ltr">Keying off that link executable variable won't work.  Here's what it's set to on MacOSX:<div><br></div><div><div><div><div>CMAKE_CXX_LINK_EXECUTABLE=<CMAKE_CXX_COMPILER>  <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES><br>
</div><p class="">Ok - so maybe what we need is this patch (which I'm testing over here now):</p><div>diff --git a/CMakeLists.txt b/CMakeLists.txt</div><div>index bad83e8..4cfa1d9 100644</div><div>--- a/CMakeLists.txt</div>
<div>+++ b/CMakeLists.txt</div><div>@@ -218,7 +218,8 @@ macro(add_lldb_library name)</div><div>   endif ()</div><div> </div><div>   if(LLDB_USED_LIBS)</div><div>-    if (LLVM_COMPILER_IS_GCC_COMPATIBLE)</div><div>+    # The Darwin linker doesn't understand --start-group/--end-group.</div>
<div>+    if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")</div><div>       target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}</div><div>                             -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)</div>
<div>     else()</div></div></div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 12:31 PM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It looks like we might be able to test ${<span style="color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:17.804800033569336px">CMAKE_CXX_LINK_EXECUTABLE} to exclude those that don't need --start-group/--end-group linker flags.</span><div>

<br></div><div>However, this is getting pretty far past the original contributor patch.  I'm more inclined to roll it back at this point until the whole thing gets more testing.</div></div><div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Jun 17, 2014 at 12:25 PM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Ok - so given it's a linker related flags issue, what is the correct cmake way to test out the linker being used?</div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 11:49 AM, Ed Maste <span dir="ltr"><<a href="mailto:emaste@freebsd.org" target="_blank">emaste@freebsd.org</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 17 June 2014 14:33, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<br>



><br>
> Hey Ed - can you test this out on FreeBSD?  This is a patch that fixes cmake on MacOSX.  I verified it works on MacOSX and Linux with cmake/ninja.<br>
><br>
> The original code looks like it was opting in for the --start-group/--end-group linker options on FreeBSD, which this patch would change but might be a no-op on your end.<br>
<br>
</div>It's odd that this is a compiler-dependent test, I'd expect it to be a<br>
linker issue.  In any case, we definitely needed --start-group and<br>
--end-group in the past.  If this test works with Linux though it will<br>
probably work with FreeBSD too.  I'll test it.<br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">


<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>


<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>


<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">

<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>

<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>

<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>