-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MLIRExecutionEngineShared doesn't build with mingw due to undefined symbols #106859
Comments
@llvm/issue-subscribers-mlir Author: None (Zentrik)
Introduced in https://github.com/llvm/llvm-project/commit/631ae59d301496f86a8d46d28f7b12afbd12a3c1. I built using mingw on 631ae59 and llvmorg-19.1.0-rc2 with `LLVM_BUILD_LLVM_DYLIB`.
The error is
Applying Zentrik@e781d06 fixes |
This might currently only work when also setting |
Thanks, I'll try that. Sorry, I should have mentioned we also have the flags |
It still failed in the same way. |
Can you provide the exact CMake command line you are using to configure the build? Also, did you completely delete and re-create the build folder before changing any flags? |
I did build completely from scratch, for extra precaution I also built it on CI. This build is with your commit reverted, https://github.com/Zentrik/llvm_windows_tester/actions/runs/10715268742, and here is one with The build script is fairly complicated, it's here https://github.com/JuliaPackaging/Yggdrasil/blob/master/L/LLVM/common.jl#L25-L401. it cross compiles in two stages, the first stage build tablegen and the second stage builds everything else. Below should be the full cmake command for the second stage from https://github.com/Zentrik/llvm_windows_tester/actions/runs/10715268742, CMAKE_CPP_FLAGS=()
CMAKE_CXX_FLAGS=()
CMAKE_C_FLAGS=()
CMAKE_FLAGS=()
CMAKE_FLAGS+=(-DCMAKE_BUILD_TYPE=Release)
CMAKE_FLAGS+=(-DLLVM_ENABLE_ASSERTIONS:BOOL=ON)
TARGETS=(host)
TARGETS+=(AMDGPU NVPTX)
TARGETS+=(WebAssembly BPF AVR)
LLVM_TARGETS=$(IFS=';' ; echo "${TARGETS[*]}")
CMAKE_FLAGS+=(-DLLVM_TARGETS_TO_BUILD:STRING=$LLVM_TARGETS)
PROJECTS=(llvm clang clang-tools-extra compiler-rt lld)
PROJECTS+=(mlir)
LLVM_PROJECTS=$(IFS=';' ; echo "${PROJECTS[*]}")
CMAKE_FLAGS+=(-DLLVM_ENABLE_PROJECTS:STRING=$LLVM_PROJECTS)
CMAKE_FLAGS+=(-DMLIR_BUILD_MLIR_C_DYLIB:BOOL=ON)
CMAKE_FLAGS+=(-DLLVM_BINDINGS_LIST="")
CMAKE_FLAGS+=(-DLLVM_ENABLE_ZLIB=ON)
CMAKE_FLAGS+=(-DLLVM_ENABLE_LIBXML2=OFF)
CMAKE_FLAGS+=(-DLLVM_INCLUDE_DOCS=Off)
CMAKE_FLAGS+=(-DLLVM_ENABLE_TERMINFO=Off)
CMAKE_FLAGS+=(-DHAVE_HISTEDIT_H=Off)
CMAKE_FLAGS+=(-DHAVE_LIBEDIT=Off)
CMAKE_FLAGS+=(-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON)
CMAKE_FLAGS+=(-DLLVM_LINK_LLVM_DYLIB:BOOL=ON)
CMAKE_FLAGS+=(-DLLVM_VERSION_SUFFIX:STRING="jl")
CMAKE_FLAGS+=(-DLLVM_SHLIB_SYMBOL_VERSION:STRING="JL_LLVM_${LLVM_MAJ_VER}.${LLVM_MIN_VER}")
CMAKE_FLAGS+=(-DCMAKE_INSTALL_PREFIX=${prefix})
CMAKE_FLAGS+=(-DCMAKE_CROSSCOMPILING=True)
CMAKE_FLAGS+=(-DCMAKE_INSTALL_BINDIR="tools")
CMAKE_FLAGS+=(-DLLVM_UTILS_INSTALL_DIR="tools")
CMAKE_FLAGS+=(-DLLVM_INCLUDE_UTILS=True -DLLVM_INSTALL_UTILS=True)
CMAKE_FLAGS+=(-DLLVM_WINDOWS_PREFER_FORWARD_SLASH=False)
CMAKE_FLAGS+=(-DLLVM_TABLEGEN=${WORKSPACE}/bootstrap/bin/llvm-tblgen)
CMAKE_FLAGS+=(-DCLANG_TABLEGEN=${WORKSPACE}/bootstrap/bin/clang-tblgen)
CMAKE_FLAGS+=(-DLLVM_CONFIG_PATH=${WORKSPACE}/bootstrap/bin/llvm-config)
CMAKE_FLAGS+=(-DMLIR_TABLEGEN=${WORKSPACE}/bootstrap/bin/mlir-tblgen)
CMAKE_FLAGS+=(-DMLIR_LINALG_ODS_YAML_GEN=${WORKSPACE}/bootstrap/bin/mlir-linalg-ods-yaml-gen)
CMAKE_FLAGS+=(-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${WORKSPACE}/bootstrap/bin/clang-tidy-confusable-chars-gen)
CMAKE_FLAGS+=(-DCLANG_PSEUDO_GEN=${WORKSPACE}/bootstrap/bin/clang-pseudo-gen)
CMAKE_FLAGS+=(-DMLIR_PDLL_TABLEGEN=${WORKSPACE}/bootstrap/bin/mlir-pdll)
CMAKE_FLAGS+=(-DLLVM_NATIVE_TOOL_DIR=${WORKSPACE}/bootstrap/bin)
CMAKE_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_clang.cmake)
CMAKE_FLAGS+=(-DLLVM_HOST_TRIPLE=${target})
CMAKE_TARGET=${target}
CMAKE_CPP_FLAGS+=(-remap -D__USING_SJLJ_EXCEPTIONS__ -D__CRT__NO_INLINE -pthread -DMLIR_CAPI_ENABLE_WINDOWS_DLL_DECLSPEC -Dmlir_arm_sme_abi_stubs_EXPORTS)
CMAKE_C_FLAGS+=(-pthread -DMLIR_CAPI_ENABLE_WINDOWS_DLL_DECLSPEC)
CMAKE_FLAGS+=(-DCOMPILER_RT_BUILD_SANITIZERS=OFF)
CMAKE_FLAGS+=(-DCLANG_INCLUDE_TESTS=OFF)
CMAKE_FLAGS+=(-DCOMPILER_RT_INCLUDE_TESTS=OFF)
CMAKE_FLAGS+=(-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF)
CMAKE_FLAGS+=(-DCMAKE_C_COMPILER_TARGET=${CMAKE_TARGET})
CMAKE_FLAGS+=(-DCMAKE_CXX_COMPILER_TARGET=${CMAKE_TARGET})
CMAKE_FLAGS+=(-DCMAKE_ASM_COMPILER_TARGET=${CMAKE_TARGET})
CMAKE_FLAGS+=(-DBUG_REPORT_URL="https://github.com/julialang/julia")
cmake -GNinja ${LLVM_SRCDIR} ${CMAKE_FLAGS[@]} -DCMAKE_CXX_FLAGS="${CMAKE_CPP_FLAGS[*]} ${CMAKE_CXX_FLAGS[*]}" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS[*]}" |
It doesn't currently build on windows, see llvm#106859.
It doesn't currently build on windows, see llvm#106859.
It doesn't currently build on windows, see llvm#106859.
It doesn't currently build on windows, see llvm#106859.
It doesn't currently build on windows, see llvm#106859.
This disabled the build of `MLIRExecutionEngineShared` because this causes linkage issues in windows for currently unknown reasons. Related issue: #106859.
This disabled the build of `MLIRExecutionEngineShared` because this causes linkage issues in windows for currently unknown reasons. Related issue: llvm#106859. (cherry picked from commit 74e1062)
This disabled the build of `MLIRExecutionEngineShared` because this causes linkage issues in windows for currently unknown reasons. Related issue: llvm#106859. (cherry picked from commit 74e1062)
Introduced in 631ae59. I built using mingw on 631ae59 and llvmorg-19.1.0-rc2 with
LLVM_BUILD_LLVM_DYLIB
.The error is
Applying Zentrik@e781d06 fixes
mlir::openOutputFile
being undefined. Not sure if the fix is to just include some other libraries as well or something different.The text was updated successfully, but these errors were encountered: