-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
raw-dylib
compilation fails targeting nightly-i686-pc-windows-gnu
when function name begins with 'L'
#104453
Labels
C-bug
Category: This is a bug.
Comments
@rustbot claim |
This was referenced Nov 15, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 21, 2022
…, r=michaelwoerister Mark functions created for `raw-dylib` on x86 with DllImport storage class Fix for rust-lang#104453 ## Issue Details On x86 Windows, LLVM uses 'L' as the prefix for any private global symbols (`PrivateGlobalPrefix`), so when the `raw-dylib` feature creates an undecorated function symbol that begins with an 'L' LLVM misinterprets that as a private global symbol that it created and so fails the compilation at a later stage since such a symbol must have a definition. ## Fix Details Mark the function we are creating for `raw-dylib` with `DllImport` storage class (this was already being done for MSVC at a later point for `callee::get_fn` but not for GNU (due to "backwards compatibility")): this will cause LLVM to prefix the name with `__imp_` and so it won't mistake it for a private global symbol.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 21, 2022
…, r=michaelwoerister Mark functions created for `raw-dylib` on x86 with DllImport storage class Fix for rust-lang#104453 ## Issue Details On x86 Windows, LLVM uses 'L' as the prefix for any private global symbols (`PrivateGlobalPrefix`), so when the `raw-dylib` feature creates an undecorated function symbol that begins with an 'L' LLVM misinterprets that as a private global symbol that it created and so fails the compilation at a later stage since such a symbol must have a definition. ## Fix Details Mark the function we are creating for `raw-dylib` with `DllImport` storage class (this was already being done for MSVC at a later point for `callee::get_fn` but not for GNU (due to "backwards compatibility")): this will cause LLVM to prefix the name with `__imp_` and so it won't mistake it for a private global symbol.
This was fixed by #104511, right? |
Correct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While testing
raw-dylib
support againstnightly-i686-pc-windows-gnu
I noticed that it would fail with a cryptic error.Here's a minimal repro: https://github.com/kennykerr/repro-raw-dylib
This compiles and runs cleanly
i686-pc-windows-msvc
but fails oni686-pc-windows-gnu
with the following error:@dpaoliello pointed out that it seems that if we have an undecorated symbol that begins with 'L' (yep) then LLVM assumes that it is an assembler label, hence the error.
The text was updated successfully, but these errors were encountered: