-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
clang "cannot select" when using wasm table builtins and -fPIC #65191
Comments
@llvm/issue-subscribers-backend-webassembly |
Actually, even with |
Hi. I am currently on holidays until Sept 11. If nobody looks at this until then, I will upon my return. |
I can reproduce the problem and will work on a fix. |
@sbc100 looking at some code you wrote some time ago:
Before Wasm tables being implemented, we used a single table for functions, which explains the condition I am not sure this is the correct behaviour. The symbol for a table is compiled to a reference to a table that is then declared with |
Under |
Looks like we just need another branch in that if/else to handle table symbols. When that code was written there were only two types of symbols: function symbols and data symbols. |
Thanks. It seems like the issue is straightforward given tables cannot be export/imported but it will become more complicated when we can have two modules sharing a table. |
@hoodmane I submitted a PR attempting to fix this. Let me know if it solves the problem you were seeing. Apologies for the delay on the fix. |
Currently tables cannot be shared between compilation units, therefore no special treatment is needed for tables. Fixes llvm#65191
Currently tables cannot be shared between compilation units, therefore no special treatment is needed for tables. Fixes #65191
Thanks so much for fixing this @pmatos! |
Example:
Source file:
Compiling as follows works:
but if I add
-fPIC
, it says:Bad/good IR
The IR looks as follows:
If I change
@table = internal addrspace(1)
to@table = local_unnamed_addr addrspace(1)
it seems to fix the problem.@pmatos
The text was updated successfully, but these errors were encountered: