-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
__imp___xxx is found in rust lib, however __imp__xxx is wanted when compiling my rust project #60866
Comments
I suspect that this block in the compiler may be wrong, if that conditional is updated to check for x86 rather than a 32-bit pointer, perhaps this would be fixed? |
I'm now building rustc again, with only the else part "_imp" to try the arm build. I cannot find a variable in the context to check x86 or ARM, suggestions @alexcrichton ? |
I think |
that particular function does not have CodegenCx which carries session, that function has only CodegenContext. Still looking...
|
btw, the private fix using one underscore worked! |
I managed to locate a function LLVMGetTarget from llvm which is supposed to return the triple, that I could use to test out x86 vs. arm
Having some trouble to use this function, it cannot be found in llvm
Not sure if this is an overkill even I make it work eventually, is there an easier/more convenient way of checking the current context is x86 or arm? @alexcrichton |
Ah I see, that's pretty late in the compiler. Currently |
Thanks! I made necessary changes to include target_arch in codegencontext and it's working well now. I sent PR to rust/master, #60895, please take a look! |
Hello
I was trying to build rustc target for thumbv7a-pc-windows-msvc locally, with a patch to compiler-builtins from this PR rust-lang/compiler-builtins#293, also hacked panic_unwind for thumbv7a similar to what we have for aarch64, https://github.com/rust-lang/rust/blob/master/src/libtest/lib.rs#L45, and I was able to build the target thumbv7a-pc-windows-msvc successfully, with below build command,
c:\python27\python.exe x.py build --host x86_64-pc-windows-msvc --build x86_64-pc-windows-msvc --target thumbv7a-pc-windows-msvc --verbose
After the build I tried to use my private tool chain to build some other rust projects, e.g. iotedged-eventlog-messages, I received below build errors. I used a few different ways to merge artifacts from different stages
I did some rough check in the thumbv7a liballoc library, interestingly, the name mangling for EMPTY_ROOT_NODE is different than most of others. The symbol wanted is
__imp__ZN5alloc11collections5btree4node15EMPTY_ROOT_NODE17h486b4088caeaa846E
, however the one that I have in the thumbv7a lib is__imp___ZN5alloc11collections5btree4node15EMPTY_ROOT_NODE17h486b4088caeaa846E
, note there are 2 underscores in the wanted symbol and 3 underscores in the actual symbol. that's because I have this symbol_ZN5alloc11collections5btree4node15EMPTY_ROOT_NODE17h486b4088caeaa846E
which already starts with an underscoreLooking at other symbols in the same lib, none of them start with a single underscore, e,g,
anon.6bd877021c225a724ec59609200b96d6.6.llvm.13430696783672607638
and__imp__anon.6bd877021c225a724ec59609200b96d6.2.llvm.13430696783672607638
.I have no idea why the toolchain is looking for
__imp__
for EMPTY_ROOT_NODE instead of looking for__imp___
Thoughts?
The text was updated successfully, but these errors were encountered: