llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.83k stars 11.01k forks source link

Canadian compilation from Linux to Windows clang-ast-dump not using native tool #76707

Open trcrsired opened 6 months ago

trcrsired commented 6 months ago
FAILED: tools/clang/lib/Tooling/ASTNodeAPI.json /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/lib/Tooling/ASTNodeAPI.json
cd /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/lib/Tooling && /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/bin/clang-ast-dump.exe --skip-processing=0 -I /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/lib/clang/18/include -I /home/cqwrteur/Projects/myllvm/llvm-project/clang/include -I /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/include -I /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/include -I /home/cqwrteur/Projects/myllvm/llvm-project/llvm/include -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/14.0.0 -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/14.0.0/x86_64-w64-mingw32 -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/14.0.0/backward -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/include -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/include-fixed -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include --json-output-path /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/lib/Tooling/ASTNodeAPI.json
run-detectors: unable to find an interpreter for /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/bin/clang-ast-dump.exe
[806/5154] Building CXX object tools/clang/lib/Tooling/Dep...obj.clangDependencyScanning.dir/ModuleDepCollector.cpp.obj
ninja: build stopped: subcommand failed.
diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt
index aff39e4de13c..b2573c251fab 100644
--- a/clang/lib/Tooling/CMakeLists.txt
+++ b/clang/lib/Tooling/CMakeLists.txt
@@ -53,6 +53,14 @@ else()
     list(APPEND implicitDirs -I ${implicitDir})
   endforeach()

+  if(NOT DEFINED CLANG_AST_DUMP)
+    if(DEFINED LLVM_NATIVE_TOOL_DIR AND NOT LLVM_NATIVE_TOOL_DIR STREQUAL "")
+      set(CLANG_AST_DUMP ${LLVM_NATIVE_TOOL_DIR}/clang-ast-dump)
+    else()
+      set(CLANG_AST_DUMP $<TARGET_FILE:clang-ast-dump>)
+    endif()
+  endif()
+
   include(GetClangResourceDir)
   get_clang_resource_dir(resource_dir PREFIX ${LLVM_BINARY_DIR})
   add_custom_command(
@@ -60,7 +68,7 @@ else()
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
       DEPENDS clang-ast-dump clang-resource-headers
       COMMAND
-      $<TARGET_FILE:clang-ast-dump>
+      ${CLANG_AST_DUMP}
         # Skip this in debug mode because parsing AST.h is too slow
         --skip-processing=${skip_expensive_processing}
         -I ${resource_dir}/include

Should fix it like this.

trcrsired commented 6 months ago
[1/3507] Generating bnf string file for cxx grammar...
FAILED: tools/clang/tools/extra/pseudo/include/CXXBNF.inc /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/tools/extra/pseudo/include/CXXBNF.inc
cd /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/tools/extra/pseudo/include && /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/bin/clang-pseudo-gen.exe --grammar /home/cqwrteur/Projects/myllvm/llvm-project/clang-tools-extra/pseudo/include/../lib/cxx/cxx.bnf --emit-grammar-content -o /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/tools/extra/pseudo/include/CXXBNF.inc
run-detectors: unable to find an interpreter for /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/bin/clang-pseudo-gen.exe
[2/3507] Generating nonterminal symbol file for cxx grammar...

Another issue. I guess it is that it tries to find out the path with .exe but native tool clearly does not have .exe since we are canadian compiling windows llvm on linux

diff --git a/clang-tools-extra/pseudo/include/CMakeLists.txt b/clang-tools-extra/pseudo/include/CMakeLists.txt
index 2334cfa12e33..605f17dd4591 100644
--- a/clang-tools-extra/pseudo/include/CMakeLists.txt
+++ b/clang-tools-extra/pseudo/include/CMakeLists.txt
@@ -3,10 +3,18 @@ set(cxx_bnf ${CMAKE_CURRENT_SOURCE_DIR}/../lib/cxx/cxx.bnf)

 setup_host_tool(clang-pseudo-gen CLANG_PSEUDO_GEN pseudo_gen pseudo_gen_target)

+if(NOT DEFINED CLANG_PSEUDO_GEN)
+   if(DEFINED LLVM_NATIVE_TOOL_DIR AND NOT LLVM_NATIVE_TOOL_DIR STREQUAL "")
+      set(CLANG_PSEUDO_GEN "${LLVM_NATIVE_TOOL_DIR}/clang_pseudo_gen")
+   else()
+      set(CLANG_PSEUDO_GEN "${pseudo_gen}")
+   endif()
+endif()
+
 # Generate inc files.
 set(cxx_symbols_inc ${CMAKE_CURRENT_BINARY_DIR}/CXXSymbols.inc)
 add_custom_command(OUTPUT ${cxx_symbols_inc}
-   COMMAND "${pseudo_gen}"
+   COMMAND "${CLANG_PSEUDO_GEN}"
      --grammar ${cxx_bnf}
      --emit-symbol-list
      -o ${cxx_symbols_inc}
@@ -16,7 +24,7 @@ add_custom_command(OUTPUT ${cxx_symbols_inc}

 set(cxx_bnf_inc ${CMAKE_CURRENT_BINARY_DIR}/CXXBNF.inc)
 add_custom_command(OUTPUT ${cxx_bnf_inc}
-   COMMAND "${pseudo_gen}"
+   COMMAND "${CLANG_PSEUDO_GEN}"
      --grammar ${cxx_bnf}
      --emit-grammar-content
      -o ${cxx_bnf_inc}
trcrsired commented 6 months ago
[2/737] Linking CXX executable bin/mlir-tblgen.exe
FAILED: bin/mlir-tblgen.exe
: && /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++ --sysroot=/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32 -Wno-array-bounds -Wno-cast-function-type -Wno-uninitialized -Wno-cast-function-type -Wa,-mbig-obj -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections  -O2 -DNDEBUG -fno-pie -Wl,--stack,16777216     -Wl,--gc-sections tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/AttrOrTypeDefGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/AttrOrTypeFormatGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/BytecodeDialectGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DialectGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DirectiveCommonGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/EnumsGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/EnumPythonBindingGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/FormatGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/LLVMIRConversionGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/LLVMIRIntrinsicGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/mlir-tblgen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpClass.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpDefinitionsGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpDocGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpFormatGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpGenHelpers.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpInterfacesGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/OpPythonBindingGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/PassCAPIGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/PassDocGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/PassGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/RewriterGen.cpp.obj tools/mlir/tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/SPIRVUtilsGen.cpp.obj -o bin/mlir-tblgen.exe -Wl,--out-implib,lib/libmlir-tblgen.dll.a -Wl,--major-image-version,0,--minor-image-version,0  lib/libLLVMCodeGenTypes.dll.a  lib/libMLIRTblgenLib.a  lib/libLLVMTableGen.dll.a  lib/libLLVMSupport.dll.a  lib/libLLVMDemangle.dll.a  lib/libMLIRTableGen.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && :
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Class.cpp.obj):Class.cpp:(.text$_ZNK4mlir6tblgen6Method11writeDeclToERNS_20raw_indented_ostreamE+0x219): undefined reference to `llvm::raw_ostream::write_escaped(llvm::StringRef, bool)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Predicate.cpp.obj):Predicate.cpp:(.text$_ZL20propagateGroundTruthPN12_GLOBAL__N_18PredNodeERKN4llvm15SmallPtrSetImplIPN4mlir6tblgen4PredEEESA_+0x3b): undefined reference to `llvm::SmallPtrSetImplBase::FindBucketFor(void const*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Predicate.cpp.obj):Predicate.cpp:(.text$_ZL20propagateGroundTruthPN12_GLOBAL__N_18PredNodeERKN4llvm15SmallPtrSetImplIPN4mlir6tblgen4PredEEESA_+0x6a): undefined reference to `llvm::SmallPtrSetImplBase::FindBucketFor(void const*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Predicate.cpp.obj):Predicate.cpp:(.text$_ZL20propagateGroundTruthPN12_GLOBAL__N_18PredNodeERKN4llvm15SmallPtrSetImplIPN4mlir6tblgen4PredEEESA_+0x233): undefined reference to `llvm::SmallPtrSetImplBase::FindBucketFor(void const*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Predicate.cpp.obj):Predicate.cpp:(.text$_ZL20propagateGroundTruthPN12_GLOBAL__N_18PredNodeERKN4llvm15SmallPtrSetImplIPN4mlir6tblgen4PredEEESA_+0x278): undefined reference to `llvm::SmallPtrSetImplBase::FindBucketFor(void const*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Constraint.cpp.obj):Constraint.cpp:(.text$_ZN4mlir6tblgen10ConstraintC2EPKN4llvm6RecordE+0x610): undefined reference to `llvm::operator<<(llvm::raw_ostream&, llvm::Record const&)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Constraint.cpp.obj):Constraint.cpp:(.text$_ZN4llvm12hash_combineIJN4mlir6tblgen4PredENS_9StringRefEEEENS_9hash_codeEDpRKT_[_ZN4llvm12hash_combineIJN4mlir6tblgen4PredENS_9StringRefEEEENS_9hash_codeEDpRKT_]+0x93): undefined reference to `llvm::hash_value(llvm::StringRef)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(GenInfo.cpp.obj):GenInfo.cpp:(.text$_ZN4mlir15GenRegistrationC2EN4llvm9StringRefES2_RKSt8functionIFbRKNS1_12RecordKeeperERNS1_11raw_ostreamEEE+0x156): undefined reference to `llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(GenInfo.cpp.obj):GenInfo.cpp:(.text$_ZN4mlir13GenNameParserC2ERN4llvm2cl6OptionE+0x216): undefined reference to `llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Operator.cpp.obj):Operator.cpp:(.text$_ZNSt17_Function_handlerIFvPN4llvm8ListInitEEZN4mlir6tblgen8Operator19populateOpStructureEvEUlS2_E_E9_M_invokeERKSt9_Any_dataOS2_+0x396): undefined reference to `llvm::SmallPtrSetImplBase::FindBucketFor(void const*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Operator.cpp.obj):Operator.cpp:(.text$_ZN4mlir6tblgen8Operator19populateOpStructureEv+0xbb1): undefined reference to `llvm::RecordRecTy::isSubClassOf(llvm::Record*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Operator.cpp.obj):Operator.cpp:(.text$_ZN4mlir6tblgen8Operator19populateOpStructureEv+0xbc4): undefined reference to `llvm::RecordRecTy::isSubClassOf(llvm::Record*) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(AttrOrTypeDef.cpp.obj):AttrOrTypeDef.cpp:(.text$_ZNK4mlir6tblgen19AttrOrTypeParameter10getCppTypeEv.part.0+0x109): undefined reference to `llvm::report_fatal_error(llvm::Twine const&, bool)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(CodeGenHelpers.cpp.obj):CodeGenHelpers.cpp:(.text$_ZN4mlir6tblgen29StaticVerifierFunctionEmitterC2ERN4llvm11raw_ostreamERKNS2_12RecordKeeperE+0x7b): undefined reference to `llvm::sys::path::filename(llvm::StringRef, llvm::sys::path::Style)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(CodeGenHelpers.cpp.obj):CodeGenHelpers.cpp:(.text$_ZN4mlir6tblgen12escapeStringB5cxx11EN4llvm9StringRefE+0xb8): undefined reference to `llvm::raw_ostream::write_escaped(llvm::StringRef, bool)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZN4mlir6tblgen13SymbolInfoMap16getValuePackNameEN4llvm9StringRefEPi+0x3d): undefined reference to `llvm::StringRef::rfind(llvm::StringRef) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZN4mlir6tblgen13SymbolInfoMap16getValuePackNameEN4llvm9StringRefEPi+0x91): undefined reference to `llvm::consumeSignedInteger(llvm::StringRef&, unsigned int, long long&)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZNK4mlir6tblgen7Pattern10getBenefitEv+0xa7): undefined reference to `llvm::PrintFatalError(llvm::Record const*, llvm::Twine const&)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZNK4mlir6tblgen7Pattern11getLocationEv+0x152): undefined reference to `llvm::SourceMgr::getLineAndColumn(llvm::SMLoc, unsigned int) const'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZNK4mlir6tblgen7Pattern14getConstraintsEv+0x5a3): undefined reference to `llvm::PrintFatalError(llvm::Record const*, llvm::Twine const&)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZN4mlir6tblgen7Pattern19collectBoundSymbolsENS0_7DagNodeERNS0_13SymbolInfoMapEb+0x45f): undefined reference to `llvm::PrintFatalError(llvm::Record const*, llvm::Twine const&)'
/home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/../../../../x86_64-w64-mingw32/bin/ld: lib/libMLIRTableGen.a(Pattern.cpp.obj):Pattern.cpp:(.text$_ZN4mlir6tblgen7Pattern19collectBoundSymbolsENS0_7DagNodeERNS0_13SymbolInfoMapEb+0x7a1): undefined reference to `llvm::PrintFatalError(llvm::Record const*, llvm::Twine const&)'
collect2: error: ld returned 1 exit status

Here is another issue with MLIR. Don't know why. It looks like it links fewer libraries than it should

JonChesterfield commented 3 months ago

I think this is fixed for clang-pseudo-gen. It's definitely still broken for clang-ast-dump. Fixed the latter with https://github.com/llvm/llvm-project/commit/b4adb42151bbfa80be4cf6d076cbe5edf680693e - it might be worth opening a separate issue for the mlir one, that seems an independent failure mode.

tbaederr commented 3 months ago

@JonChesterfield It seems like this change causes the clang build to build certain things twice (I'm not sure what this is limited to). See for example this output:

[1/16] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/Interp/InterpBuiltin.cpp.o
/home/tbaeder/code/llvm-project/clang/lib/AST/Interp/InterpBuiltin.cpp:19:17: warning: unused function 'callArgSize' [-Wunused-function]
   19 | static unsigned callArgSize(const InterpState &S, const CallExpr *C) {
      |                 ^~~~~~~~~~~
1 warning generated.
[3/16] Building native clang-ast-dump...
[1/3] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/Interp/InterpBuiltin.cpp.o
/home/tbaeder/code/llvm-project/clang/lib/AST/Interp/InterpBuiltin.cpp:851:7: warning: unused variable 'a' [-Wunused-variable]
  851 |   int a = 1;
      |       ^
/home/tbaeder/code/llvm-project/clang/lib/AST/Interp/InterpBuiltin.cpp:19:17: warning: unused function 'callArgSize' [-Wunused-function]
   19 | static unsigned callArgSize(const InterpState &S, const CallExpr *C) {
      |                 ^~~~~~~~~~~
2 warnings generated.
[3/3] Linking CXX executable bin/clang-ast-dump
[14/14] Linking CXX executable bin/clang-import-test

The unused function warning is printed twice because the TU is built twice. To make matters worse, the clang-ast-dump build seems to have assertions disabled.