Dan, this is causing "llvm-config --libs native jit" to emit -lLLVMX86Disassembler, which we don't want.<br><br>It's not clear to me why we have this case in the first place (I realize you merely extended existing logic) and the FIXME comment isn't sufficiently clarifying for me. It's low priority, but this is one of the many things blocking unladen-swallow integration with mainline python.<br>

<br>Nick<br><br><div class="gmail_quote">On 24 November 2009 20:46, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Author: ddunbar<br>
Date: Tue Nov 24 22:46:58 2009<br>
New Revision: 89841<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=89841&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=89841&view=rev</a><br>
Log:<br>
Add the rest of the build system logic for optional target disassemblers<br>
<br>
Modified:<br>
    llvm/trunk/Makefile<br>
    llvm/trunk/Makefile.rules<br>
    llvm/trunk/cmake/modules/LLVMConfig.cmake<br>
    llvm/trunk/include/llvm/Target/TargetSelect.h<br>
    llvm/trunk/tools/llvm-config/<a href="http://llvm-config.in.in" target="_blank">llvm-config.in.in</a><br>
<br>
Modified: llvm/trunk/Makefile<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=89841&r1=89840&r2=89841&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=89841&r1=89840&r2=89841&view=diff</a><br>


<br>
==============================================================================<br>
--- llvm/trunk/Makefile (original)<br>
+++ llvm/trunk/Makefile Tue Nov 24 22:46:58 2009<br>
@@ -155,9 +155,11 @@<br>
 FilesToConfig := \<br>
   include/llvm/Config/config.h \<br>
   include/llvm/Config/Targets.def \<br>
-       include/llvm/Config/AsmPrinters.def \<br>
+  include/llvm/Config/AsmPrinters.def \<br>
+  include/llvm/Config/AsmParsers.def \<br>
+  include/llvm/Config/Disassemblers.def \<br>
   include/llvm/System/DataTypes.h \<br>
-       tools/llvmc/plugins/Base/Base.td<br>
+  tools/llvmc/plugins/Base/Base.td<br>
 FilesToConfigPATH  := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))<br>
<br>
 all-local:: $(FilesToConfigPATH)<br>
<br>
Modified: llvm/trunk/Makefile.rules<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=89841&r1=89840&r2=89841&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=89841&r1=89840&r2=89841&view=diff</a><br>


<br>
==============================================================================<br>
--- llvm/trunk/Makefile.rules (original)<br>
+++ llvm/trunk/Makefile.rules Tue Nov 24 22:46:58 2009<br>
@@ -1565,6 +1565,11 @@<br>
        $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"<br>
        $(Verb) $(TableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<<br>
<br>
+$(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \<br>
+$(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir<br>
+       $(Echo) "Building $(<F) disassembly tables with tblgen"<br>
+       $(Verb) $(TableGen) -gen-disassembler -o $(call SYSPATH, $@) $<<br>
+<br>
 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \<br>
 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir<br>
        $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"<br>
<br>
Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=89841&r1=89840&r2=89841&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=89841&r1=89840&r2=89841&view=diff</a><br>


<br>
==============================================================================<br>
--- llvm/trunk/cmake/modules/LLVMConfig.cmake (original)<br>
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake Tue Nov 24 22:46:58 2009<br>
@@ -32,7 +32,7 @@<br>
 function(explicit_map_components_to_libraries out_libs)<br>
   set( link_components ${ARGN} )<br>
   foreach(c ${link_components})<br>
-    # add codegen, asmprinter, asmparser<br>
+    # add codegen, asmprinter, asmparser, disassembler<br>
     list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)<br>
     if( NOT idx LESS 0 )<br>
       list(FIND llvm_libs "LLVM${c}CodeGen" idx)<br>
@@ -58,6 +58,10 @@<br>
       if( NOT asmidx LESS 0 )<br>
         list(APPEND expanded_components "LLVM${c}Info")<br>
       endif()<br>
+      list(FIND llvm_libs "LLVM${c}Disassembler" asmidx)<br>
+      if( NOT asmidx LESS 0 )<br>
+        list(APPEND expanded_components "LLVM${c}Disassembler")<br>
+      endif()<br>
     elseif( c STREQUAL "native" )<br>
       list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}CodeGen")<br>
     elseif( c STREQUAL "nativecodegen" )<br>
<br>
Modified: llvm/trunk/include/llvm/Target/TargetSelect.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=89841&r1=89840&r2=89841&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=89841&r1=89840&r2=89841&view=diff</a><br>


<br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Target/TargetSelect.h (original)<br>
+++ llvm/trunk/include/llvm/Target/TargetSelect.h Tue Nov 24 22:46:58 2009<br>
@@ -33,6 +33,10 @@<br>
   // Declare all of the available assembly parser initialization functions.<br>
 #define LLVM_ASM_PARSER(TargetName) void LLVMInitialize##TargetName##AsmParser();<br>
 #include "llvm/Config/AsmParsers.def"<br>
+<br>
+  // Declare all of the available disassembler initialization functions.<br>
+#define LLVM_DISASSEMBLER(TargetName) void LLVMInitialize##TargetName##Disassembler();<br>
+#include "llvm/Config/Disassemblers.def"<br>
 }<br>
<br>
 namespace llvm {<br>
@@ -79,6 +83,16 @@<br>
 #include "llvm/Config/AsmParsers.def"<br>
   }<br>
<br>
+  /// InitializeAllDisassemblers - The main program should call this function if<br>
+  /// it wants all disassemblers that LLVM is configured to support, to make<br>
+  /// them available via the TargetRegistry.<br>
+  ///<br>
+  /// It is legal for a client to make multiple calls to this function.<br>
+  inline void InitializeAllDisassemblers() {<br>
+#define LLVM_DISASSEMBLER(TargetName) LLVMInitialize##TargetName##Disassembler();<br>
+#include "llvm/Config/Disassemblers.def"<br>
+  }<br>
+<br>
   /// InitializeNativeTarget - The main program should call this function to<br>
   /// initialize the native target corresponding to the host.  This is useful<br>
   /// for JIT applications to ensure that the target gets linked in correctly.<br>
<br>
Modified: llvm/trunk/tools/llvm-config/<a href="http://llvm-config.in.in" target="_blank">llvm-config.in.in</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/llvm-config.in.in?rev=89841&r1=89840&r2=89841&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/llvm-config.in.in?rev=89841&r1=89840&r2=89841&view=diff</a><br>


<br>
==============================================================================<br>
--- llvm/trunk/tools/llvm-config/<a href="http://llvm-config.in.in" target="_blank">llvm-config.in.in</a> (original)<br>
+++ llvm/trunk/tools/llvm-config/<a href="http://llvm-config.in.in" target="_blank">llvm-config.in.in</a> Tue Nov 24 22:46:58 2009<br>
@@ -333,6 +333,10 @@<br>
         if (defined $NAME_MAP{$target.'asmparser'}) {<br>
             push @{$NAME_MAP{$target}},$target.'asmparser'<br>
         }<br>
+<br>
+        if (defined $NAME_MAP{$target.'disassembler'}) {<br>
+            push @{$NAME_MAP{$target}},$target.'disassembler'<br>
+        }<br>
     }<br>
<br>
     # Add virtual entries.<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>