Skip to content

Cargo xbuild fails to build with older rustc nightly #74

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

Closed
ghost opened this issue May 13, 2020 · 8 comments · Fixed by #75
Closed

Cargo xbuild fails to build with older rustc nightly #74

ghost opened this issue May 13, 2020 · 8 comments · Fixed by #75

Comments

@ghost
Copy link

ghost commented May 13, 2020

I'm using nightly-2020-02-24, but cargo xbuild tries to build core crate with lastest rust-src, which failed. cargo xbuild need a way to specify which rust-src to use when building core crate.

@phil-opp
Copy link
Member

Cargo-xbuild uses the rust-src component provided by rustup, so it should always be in sync with with your nightly version. What error message are you seeing exactly?

@ghost
Copy link
Author

ghost commented May 13, 2020

error[E0635]: unknown feature `llvm_asm`
 --> /home/william/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.28/src/lib.rs:3:12
  |
3 | #![feature(llvm_asm)]
  |   

@ghost
Copy link
Author

ghost commented May 13, 2020

llvm_asm just included in recent version of rust, and I have no problems compile core crate in the past (about 2 months ago). So I think cargo xbuild must pull new version of rust-src

@ghost
Copy link
Author

ghost commented May 13, 2020

looking at compiler builtins version, i'm sure that it tries to compile latest rust-src

@ghost
Copy link
Author

ghost commented May 13, 2020

By the way, the very reason i'm trying to use old nightly is that nightly-2020-05-12 don't let me link my kernel to higher haft address, it's just throw alots of R_x86_64_32 relocations errors.

@phil-opp
Copy link
Member

The problem is that the alloc library itself has a dependency on the compiler_builtins crate from crates.io: https://github.com/rust-lang/rust/blob/750db09fa800dceebba57d609d42969172118c92/src/liballoc/Cargo.toml#L15

This library just received an update that switches to llvm_asm: rust-lang/compiler-builtins#351. Given that it was released as a normal patch release, cargo automatically tries to use the latest version if there is no lockfile.

To fix this issue, we need to update cargo-xbuild to respect the lockfile (i.e. the Cargo.lock) of the rust-src component. I opened #75 to fix this. Could you try whether this new version works for you? You can install it through:

cargo install cargo-xbuild --git https://github.com/rust-osdev/cargo-xbuild.git --branch respect-lockfile  --debug --force

@ghost
Copy link
Author

ghost commented May 13, 2020

That worked! But I still have problems linking code to higher address when using cargo xbuild, guess I will open new issue for this. Thanks!

@ghost ghost closed this as completed May 13, 2020
@phil-opp
Copy link
Member

Great, I will merge the PR then!

This issue was closed.
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.

1 participant