<div dir="ltr">Thanks, Zachary.<div><br></div><div>Ed - I'm testing the patch on my FreeBSD VM. Finally firing it up again...</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 1:13 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@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">Yes, this was for building with MSVC, which does not support those linker options. I guess either the patch you sent out earlier, or explicitly excluding those compilers which don't support this flag works.</div>
<div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 1:11 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">Zachary - were you trying to build on Windows without a gcc-compatible compiler, and getting linker errors/warnings in that case?<div><br></div><div>If so, a correct check might really be the final patch I sent out earlier:</div>
<div>
<div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">diff --git a/CMakeLists.txt b/CMakeLists.txt</div><div style="font-family:arial,sans-serif;font-size:13px">index bad83e8..4cfa1d9 100644</div><div style="font-family:arial,sans-serif;font-size:13px">
--- a/CMakeLists.txt</div><div style="font-family:arial,sans-serif;font-size:13px">+++ b/CMakeLists.txt</div><div style="font-family:arial,sans-serif;font-size:13px">@@ -218,7 +218,8 @@ macro(add_lldb_library name)</div>
<div style="font-family:arial,sans-serif;font-size:13px">
endif ()</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px"> if(LLDB_USED_LIBS)</div><div style="font-family:arial,sans-serif;font-size:13px">
- if (LLVM_COMPILER_IS_GCC_COMPATIBLE)</div><div style="font-family:arial,sans-serif;font-size:13px">+ # The Darwin linker doesn't understand --start-group/--end-group.</div><div style="font-family:arial,sans-serif;font-size:13px">
+ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")</div><div style="font-family:arial,sans-serif;font-size:13px"></div></div><div><br></div></div></div><div>
<div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 1:02 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">This latest patch works on Ubuntu12.04/gcc4.8.2 and MacOSX10.9.3/clang. But thinking more about it, the predicate as a whole (changing based on compiler rather than Linker) is just incorrect. So the platform checks there before, which isn't a bad proxy for the system linker requirements, is a better check than the compiler test.<div>
<br></div><div>Zachary - what were you originally intending to address with the change? Which platform(s) were affected by the patch? We can possibly handle that via another mechanism. In hindsight I'm not a big fan of testing the compiler since it isn't enough to get this right on all platofmrs</div>
<span><font color="#888888">
<div><br></div><div>-Todd</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 12:43 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">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>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><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><div><br></div></div><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><div>
<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>
</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>
</div></div></blockquote></div><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>