Skip to content
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

*-pc-windows-msvc Rustc targets are not supported #1

Closed
denzp opened this issue Aug 21, 2018 · 7 comments · Fixed by #7
Closed

*-pc-windows-msvc Rustc targets are not supported #1

denzp opened this issue Aug 21, 2018 · 7 comments · Fixed by #7

Comments

@denzp
Copy link
Owner

denzp commented Aug 21, 2018

Shared LLVM lib exports a very limited amount of symbols for the targets.

tests fail with: Unable to find symbol 'LLVMModuleCreateWithName' in the LLVM shared lib
ptx-linker fails with: Unable to find symbol 'LLVMContextCreate' in the LLVM shared lib

If that can't be fixed, we should at least provide a meaningful error message and a hint to use *-pc-windows-gnu.

@bheisler
Copy link

What would it take to fix this?

@denzp
Copy link
Owner Author

denzp commented Aug 28, 2018

Well, I'm not really sure... Seems like it has something to do about linker during rustc compilation process: apparently it strips unused symbols.

I don't have access to the platform, so I can't even debug problem origins. I think it worth creating an issue in Rust repo.

@bheisler
Copy link

I do have access to Windows (obviously) and I'd be willing to help debug and fix this, but I don't really know what to look for.

@denzp
Copy link
Owner Author

denzp commented Aug 31, 2018

Can you please try to build rustc from sources and check what symbols are being exported from rustc_codegen_llvm-llvm.dll on different compilation stages? Maybe we would have more symbols in debug build?

This question would probably help us to find out when are they getting stripped (are they?) and adjust the build process.

We are particularly looking for LLVMModuleCreateWithName or LLVMContextCreate symbols.

@bheisler
Copy link

bheisler commented Sep 6, 2018

In my build the stage 0 build contains the LLVMContextDestroy symbol, but not LLVMContextCreate. That's a bit strange - if something is stripping symbols, why would it strip only one?

I haven't been able to build stage 1 successfully yet (rust-lang/rust#53014). Will add more details when I can - I'm trying a clean rebuild without the -i flag to see if that helps.

@retep998
Copy link

retep998 commented Sep 6, 2018

The msvc linker exports precisely what it is told to export. Everything else is not exported, and if a symbol is not (transitively) referenced by something which is exported then it will be stripped entirely. If you're failing to find certain symbols in rustc_codegen_llvm-llvm.dll which you think should be there, then rustc is not telling the linker to export them.

@bheisler
Copy link

I think that means we would either have to land a patch to Rust explicitly exposing these functions in that crate (might be difficult, I doubt that's intended to be public API), or somehow make the llvm-proxy work without them. Is that possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants