rust-osdev / cargo-xbuild

Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.
Apache License 2.0
258 stars 25 forks source link

The compiler_builtins library is now a crates.io dependency of alloc #23

Closed phil-opp closed 5 years ago

phil-opp commented 5 years ago

https://github.com/rust-lang/rust/pull/56092 changed the build process of the sysroot in the following way:

The compiler_builtins is now a normal crates.io crate: https://crates.io/crates/compiler_builtins. Since compiler_buitlins depends on libcore, but no sysroot exists yet when building liballoc, it has a special rustc-std-workspace-core feature that overwrites the core dependency with an empty crates.io crate called rustc-std-workspace-core. This makes it possible to override the core dependency through a patch section in the Cargo.toml of liballoc.

For time reasons, this PR takes a different approach: Instead of using the rustc-std-workspace-core feature and a patch section to build core together with liballoc, we keep on building core first and then set the sysroot in RUSTFLAGS when compiling liballoc. This way, both liballoc and compiler_builtins use the core library that we built in the previous step.

Fixes #22

phil-opp commented 5 years ago

Published as 0.5.1

HadrienG2 commented 5 years ago

Thanks for saving the uefi-rs build! :smiley:

phil-opp commented 5 years ago

You're welcome :)