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

Add object::write as alternative object file writer #758

Merged
merged 7 commits into from
Oct 19, 2019
Merged

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Oct 16, 2019

Based on philipc@3db2996 by @philipc.

TODO

  • Change driver.rs to use when a feature flag is set.

@philipc
Copy link
Contributor

philipc commented Oct 17, 2019

Sorry I haven't had time to finish this off. Let me know if I can do anything to help debug the osx failure.

@bjorn3
Copy link
Member Author

bjorn3 commented Oct 17, 2019

No problem. The macOS failure is not caused by this. It fails on master too: https://github.com/bjorn3/rustc_codegen_cranelift/issues/728. Upstream issue: rust-lang/rust#64872.

@bjorn3 bjorn3 marked this pull request as ready for review October 18, 2019 15:19
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 18, 2019

@philipc Do you want to review this PR before I merge?

@bjorn3 bjorn3 added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Oct 18, 2019
Copy link
Contributor

@philipc philipc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

I tried testing this for Windows but something unrelated to this PR has changed and I'm getting errors when linking:

note: LINK : fatal error LNK1181: cannot open input file 'c.lib'

src/backend.rs Outdated Show resolved Hide resolved
src/debuginfo.rs Outdated Show resolved Hide resolved
src/driver.rs Outdated Show resolved Hide resolved
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 19, 2019

I tried testing this for Windows but something unrelated to this PR has changed and I'm getting errors when linking:

note: LINK : fatal error LNK1181: cannot open input file 'c.lib'

Thanks for testing.

Disclaimer: I have never used a compiler on Windows.

It seems to me that the linker couldn't find libc. rustc without cg_clif works for you right? cg_clif should use the same linker invocation as cg_llvm, as cg_clif uses rustc_codegen_ssa::back::link::link_binary just like cg_llvm.

@philipc
Copy link
Contributor

philipc commented Oct 19, 2019

rustc without cg_clif works for you right? cg_clif should use the same linker invocation as cg_llvm, as cg_clif uses rustc_codegen_ssa::back::link::link_binary just like cg_llvm.

rustc works for normal crates. But test.sh doesn't work even if I'm using rustc_codegen_llvm instead of cg_clif. I'll need to compare linker invocations with the older version to see what's changed.

@bjorn3
Copy link
Member Author

bjorn3 commented Oct 19, 2019

I think I know. It is mini_core which failed, isn't it? That one links to libc. I saw that you changed that to msvcrt on your windows branch, which I didnt cherry-pick.

@philipc
Copy link
Contributor

philipc commented Oct 19, 2019

Thanks, yep that's what it is. I don't even remember doing that change. There's other changes needed too. I'll work on a PR for Windows once this is merged.

@bjorn3 bjorn3 merged commit 75c24b9 into master Oct 19, 2019
@bjorn3 bjorn3 deleted the object_write branch October 19, 2019 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants