Bill, Daniel;<div><br></div><div>This patch (and its sibling r143532) *might* be interesting for 3.0. This is from a report on IRC of the 3.0 release candidate failing to link clang-tblgen correctly when LLVM was installed as a separate library. Daniel and I found the problem via inspection and I don't personally have a reproduction so I don't have a great idea of how likely (or unlikely) others hitting this problem will be.</div>
<div><br></div><div>I'll update the thread if the person who reported it is able to reproduce and confirm that this fixes the issue.<br><br><div class="gmail_quote">On Tue, Nov 1, 2011 at 10:03 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Author: chandlerc<br>
Date: Wed Nov  2 00:03:06 2011<br>
New Revision: 143531<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=143531&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=143531&view=rev</a><br>
Log:<br>
The TableGen parts of the CMake build are seriously broken. This fixes<br>
one aspect of them by having them use the (annoying, if not broken)<br>
proper library dependency model for adding the LLVMTableGen library as<br>
a dependency. This could manifest as a link order issue in the presence<br>
of separate LLVM / Clang source builds with CMake and a linker that<br>
really cares about such things.<br>
<br>
Also, add the Support dependency to llvm-tblgen itself so that it<br>
doesn't rely on TableGen's transitive Support dependency. A parallel<br>
change for clang-tblgen will be forthcoming.<br>
<br>
Modified:<br>
    llvm/trunk/cmake/modules/TableGen.cmake<br>
    llvm/trunk/utils/TableGen/CMakeLists.txt<br>
<br>
Modified: llvm/trunk/cmake/modules/TableGen.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=143531&r1=143530&r2=143531&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=143531&r1=143530&r2=143531&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/cmake/modules/TableGen.cmake (original)<br>
+++ llvm/trunk/cmake/modules/TableGen.cmake Wed Nov  2 00:03:06 2011<br>
@@ -76,7 +76,10 @@<br>
 macro(add_tablegen target project)<br>
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})<br>
<br>
+  set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})<br>
+  set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)<br>
   add_llvm_utility(${target} ${ARGN})<br>
+  set(LLVM_LINK_COMPONENTS ${target}_OLD_LLVM_LINK_COMPONENTS)<br>
<br>
   set(${project}_TABLEGEN "${target}" CACHE<br>
       STRING "Native TableGen executable. Saves building one when cross-compiling.")<br>
@@ -110,7 +113,6 @@<br>
     endif()<br>
   endif()<br>
<br>
-  target_link_libraries(${target} LLVMSupport LLVMTableGen)<br>
   if( MINGW )<br>
     target_link_libraries(${target} imagehlp psapi)<br>
     if(CMAKE_SIZEOF_VOID_P MATCHES "8")<br>
<br>
Modified: llvm/trunk/utils/TableGen/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=143531&r1=143530&r2=143531&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=143531&r1=143530&r2=143531&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/utils/TableGen/CMakeLists.txt (original)<br>
+++ llvm/trunk/utils/TableGen/CMakeLists.txt Wed Nov  2 00:03:06 2011<br>
@@ -1,5 +1,6 @@<br>
 set(LLVM_REQUIRES_EH 1)<br>
 set(LLVM_REQUIRES_RTTI 1)<br>
+set(LLVM_LINK_COMPONENTS Support)<br>
<br>
 add_tablegen(llvm-tblgen LLVM<br>
   ARMDecoderEmitter.cpp<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">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>
</blockquote></div><br></div>