<div dir="ltr">Actually, I guess this qualifies as an 'obvious' fix, so I've submitted the trivial patch.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 10, 2014 at 2:42 PM, Tom Roeder <span dir="ltr"><<a href="mailto:tmroeder@google.com" target="_blank">tmroeder@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 seems to break the cmake/ninja version of LLVMgold.so; the plugin no longer links correctly against libLTO.so, so it can't be loaded by ld. We need to restore (part of) the last line in tools/gold/CMakeLists.txt, as follows:<div>


<br></div><div>target_link_libraries(LLVMgold LTO)</div><div><br></div><div>at the end of tools/gold/CMakeLists.txt.  I've added that back in locally and tested it with cmake/ninja and cmake/make, and it works.</div>


<div><br></div><div>I'll submit a patch to fix this if this looks right.<br>
<div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sat, Dec 28, 2013 at 3:54 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div>On Sat, Dec 28, 2013 at 6:31 PM, Nico Weber <span dir="ltr"><<a href="mailto:nicolasweber@gmx.de" target="_blank">nicolasweber@gmx.de</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">EXPORTED_SYMBOL_FILE support for cmake<br>
<br>
The cmake build didn't support EXPORTED_SYMBOL_FILE. Instead, it had a<br>
Windows-only implementation in tools/lto/CMakeLists.txt, a linux-only<br>
implementation in tools/gold/CMakeLists.txt, and a darwin-only implementation<br>
in tools/clang/tools/libclang/CMakeLists.txt.<br>
<br>
This attempts to consolidate these one-offs into a single place. Clients can now<br>
just set LLVM_EXPORTED_SYMBOL_FILE and things (hopefully) Just Work, like in<br>
the make build.<br></div></blockquote><div><br></div></div><div>Really cool! Did you look at the compiler-rt stuff to use and/or replace some of it?</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="overflow:hidden">
<br>
Modified:<br>
    llvm/trunk/cmake/modules/AddLLVM.cmake<br>
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake<br>
    llvm/trunk/tools/gold/CMakeLists.txt<br>
    llvm/trunk/tools/lto/CMakeLists.txt<br>
<br>
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=198136&r1=198135&r2=198136&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=198136&r1=198135&r2=198136&view=diff</a><br>




==============================================================================<br>
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)<br>
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Sat Dec 28 17:31:44 2013<br>
@@ -2,6 +2,72 @@ include(LLVMParseArguments)<br>
 include(LLVMProcessSources)<br>
 include(LLVM-Config)<br>
<br>
+function(add_llvm_symbol_exports target_name export_file)<br>
+  if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")<br>
+    set(native_export_file "symbol.exports")<br>
+    add_custom_command(OUTPUT symbol.exports<br>
+      COMMAND sed -e "s/^/_/" < ${export_file} > symbol.exports<br>
+      DEPENDS ${export_file}<br>
+      VERBATIM<br>
+      COMMENT "Creating export file for ${target_name}")<br>
+    set_property(TARGET ${target_name} APPEND_STRING PROPERTY<br>
+                 LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/symbol.exports")<br>
+  elseif(LLVM_HAVE_LINK_VERSION_SCRIPT)<br>
+    # Gold and BFD ld require a version script rather than a plain list.<br>
+    set(native_export_file "symbol.exports")</div></blockquote></div></div></div><br>It looks like you can't have two different export files for two different targets which are built in the same directory? That's unfortunate. While LLVM's makefile build system doesn't support building two targets in a single directory, CMake generally does and it would be nice to preserve this. I think it is even used in the sanitizers.</div>



</div>
<br></div></div><div class="im">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></div></blockquote></div><br></div>
</blockquote></div><br></div>