-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Implicit instantiation of TypeID is incompatible with building with -BSymbolic #50762
Comments
assigned to @joker-eph |
still happens in 13.0-rc3 |
Nicolas: can you look into this? |
Hi, I tried to reproduce the problem using the following commands: git clone https://github.com/llvm/llvm-project.git Building and running the mlir tests works fine for me. I hope I did catch the right commit? Also can you share your cmake configuration in case this is an artifact of a particular setup? Best |
My failing build is part of a much larger build (all components, all targets). Will try to reproduce with fewer stuff and isolate what's triggering the breakage. |
Confirmed that it builds for me in the minimal config as well |
There is something fishy somewhere, the tool |
I've narrowed it down - |
it's not a serious problem after all, it happens if the tools are built with "-Wl,-Bsymbolic". Simply optimizing a little less and not making the assumption that this is safe fixes the problem. Still might be worth documenting somewhere. I don't see an obvious reason why -Wl,-Bsymbolic would break this. |
Thanks for analyzing. I can confirm that adding -Wl,-Bsymbolic seems problematic (to CMAKE_MODULE_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS). It still builds for me but almost all mlir tests fail. I lack the linker / cmake expertise to understand the root cause. Looking at the error messages it could be that type uniquing does not work anymore. A solution could be documentation or even better adding a check in the cmake file to emit a warning if the flag is set. Let me know if you know a reliable way of doing that? Tobias |
Ah right, |
cmake -GNinja -Hllvm -Bout/release -DCMAKE_C_COMPILER= This is a pointer equality for variables problem, likely related to TypeID (I ruled out the copy relocations because with Just stick with -Wl,-Bsymbolic-functions. |
typo. there is no copy relocation |
Right: the templated function returns the address of a local static variable. |
We can't fix this in time for LLVM 13 release. It is also not a regression from LLVM 12 or 11 I believe. |
However we could error at the CMake level if Bsymbolic is set. |
Sent https://reviews.llvm.org/D110483 to do just that |
Should we backport this to the release/13.x branch? |
It would be "nice to have", feel free to cherry-pick this! |
Merged: d5159b9 |
The bug isn't fixed in the sense that we don't support it. The commit back ported is just error detection at CMake time. |
mentioned in issue #51489 |
I'm going to remove this from the Release 13.0.1 Milestone since the release branch portion of this issue has been done. |
Extended Description
Building LLVM 13.0-rc1 with MLIR enabled fails:
cd /home/bero/abf/llvm/BUILD/llvm-project-release-13.x/build/tools/mlir/include/mlir/Dialect/Linalg/IR && /home/bero/abf/llvm/BUILD/llvm-project-release-13.x/build/bin/mlir-linalg-ods-yaml-gen /home/bero/abf/llvm/BUILD/llvm-project-release-13.x/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml -o-ods-decl=/home/bero/abf/llvm/BUILD/llvm-project-release-13.x/build/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.td -o-impl=/home/bero/abf/llvm/BUILD/llvm-project-release-13.x/build/tools/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.cpp.inc
YAML:19:16: error: could not parse as an affine map attribute
shape_map: affine_map<()[s0, s1, s2] -> (s0, s1)>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered: