| Issue |
76739
|
| Summary |
mlir build linkage error from linux to windows
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
trcrsired
|
```
[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
```
```cmake
cmake_minimum_required(VERSION 3.15)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_HOST_SYSTEM_NAME "Windows")
set(TOOLCHAIN_TRIPLE x86_64-w64-mingw32)
set(LLVM_HOST_TRIPLE x86_64-windows-gnu)
set(LLVM_DEFAULT_TARGET_TRIPLE ${LLVM_HOST_TRIPLE})
execute_process(
COMMAND which ${TOOLCHAIN_TRIPLE}-gcc
OUTPUT_VARIABLE BINUTILS_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
get_filename_component(TOOLCHAIN_BIN ${BINUTILS_PATH} DIRECTORY)
execute_process(
COMMAND which clang
OUTPUT_VARIABLE CLANGBIN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
get_filename_component(LLVM_NATIVE_TOOL_DIR_PATH ${CLANGBIN_PATH} DIRECTORY)
set(LLVM_NATIVE_TOOL_DIR ${LLVM_NATIVE_TOOL_DIR_PATH})
set(TOOLCHAIN_COMMON_FLAGS "-Wno-array-bounds -Wno-cast-function-type -Wno-uninitialized -Wno-cast-function-type")
set(CMAKE_C_FLAGS ${TOOLCHAIN_COMMON_FLAGS})
set(CMAKE_CXX_FLAGS ${TOOLCHAIN_COMMON_FLAGS})
set(CMAKE_C_COMPILER ${TOOLCHAIN_TRIPLE}-gcc)
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_TRIPLE}-g++)
set(CMAKE_AR ${TOOLCHAIN_TRIPLE}-ar)
set(CMAKE_RANLIB ${TOOLCHAIN_TRIPLE}-ranlib)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(ZLIB_LIBRARY ${CMAKE_SYSROOT}/${TOOLCHAIN_TRIPLE}/lib/libzlibstatic.a)
set(ZLIB_INCLUDE_DIR ${CMAKE_SYSROOT}/${TOOLCHAIN_TRIPLE}/include)
unset(linux)
unset(unix)
unset(Linux)
unset(Unix)
set(MINGW 1)
set(WIN32 1)
set(LLVM_ENABLE_PROJECTS "clang;lld;clang-tools-extra;lldb;mlir")
set(HAVE_CXX_FLAG_WTHREAD_SAFETY Off)
set(HAVE_STEADY_CLOCK Off)
set(BENCHMARK_ENABLE_TESTING Off)
set(LLVM_OPTIMIZED_TABLEGEN On)
set(LLVM_INCLUDE_BENCHMARKS Off)
set(LLVM_ENABLE_PIC Off)
set(LLVM_ENABLE_ASSERTIONS Off)
set(LLVM_ENABLE_UNWIND_TABLES Off)
set(LLVM_INCLUDE_EXAMPLES Off)
set(LLVM_ENABLE_BACKTRACES Off)
set(LLVM_INCLUDE_TESTS Off)
set(BUILD_SHARED_LIBS On)
set(LLVM_ENABLE_RUNTIMES "")
execute_process(
COMMAND which llvm-tblgen
OUTPUT_VARIABLE LLVM_TABLEGEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(LLVM_TABLEGEN ${LLVM_TABLEGEN_PATH})
execute_process(
COMMAND which clang-tblgen
OUTPUT_VARIABLE CLANG_TABLEGEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CLANG_TABLEGEN ${CLANG_TABLEGEN_PATH})
set(CLANG_TBLGEN ${CLANG_TABLEGEN})
execute_process(
COMMAND which clang-pseudo-gen
OUTPUT_VARIABLE CLANG_PSEUDO_GEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CLANG_PSEUDO_GEN ${CLANG_PSEUDO_GEN_PATH})
execute_process(
COMMAND which llvm-profgen
OUTPUT_VARIABLE LLVM_PROFGEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(LLVM_PROFGEN ${LLVM_PROFGEN_PATH})
execute_process(
COMMAND which lldb-tblgen
OUTPUT_VARIABLE LLDB_TBLGEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(LLDB_TABLEGEN_EXE ${LLDB_TBLGEN_PATH})
execute_process(
COMMAND which mlir-tblgen
OUTPUT_VARIABLE MLIR_TBLGEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(MLIR_TABLEGEN ${MLIR_TBLGEN_PATH})
execute_process(
COMMAND which clang-ast-dump
OUTPUT_VARIABLE CLANG_AST_DUMP_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CLANG_AST_DUMP ${CLANG_AST_DUMP_PATH})
execute_process(
COMMAND which clang-tidy-confusable-chars-gen
OUTPUT_VARIABLE CLANG_TIDY_CONFUSABLE_CHARS_GEN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CLANG_TIDY_CONFUSABLE_CHARS_GEN ${CLANG_TIDY_CONFUSABLE_CHARS_GEN_PATH})
set(clang_tidy_confusable_chars_gen ${CLANG_TIDY_CONFUSABLE_CHARS_GEN})
execute_process(
COMMAND which mlir-linalg-ods-yaml-gen
OUTPUT_VARIABLE MLIR_LINALG_ODS_YAML_GEN_EXE_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(MLIR_LINALG_ODS_YAML_GEN_EXE ${MLIR_LINALG_ODS_YAML_GEN_EXE_PATH})
set(HAVE_CXX_ATOMICS64_WITHOUT_LIB On)
set(HAVE_CXX_ATOMICS_WITHOUT_LIB On)
set(LLDB_INCLUDE_TESTS Off)
set(CMAKE_CROSSCOMPILING On)
set(LLVM_HOST_EXECUTABLE_SUFFIX "")
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs