forked from rust-lang/rustc_codegen_cranelift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using xargo for building the sysroot
It is currently broken. (see japaric/xargo#227) This makes it easier to for example patch whole crates away.
- Loading branch information
Showing
21 changed files
with
121 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ target | |
*.o | ||
perf.data | ||
perf.data.old | ||
/build_sysroot/sysroot | ||
/build_sysroot/sysroot_src | ||
/build_sysroot/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
authors = ["bjorn3 <[email protected]>"] | ||
name = "sysroot" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
core = { path = "./sysroot_src/src/libcore" } | ||
compiler_builtins = "0.1" | ||
alloc = { path = "./sysroot_src/src/liballoc" } | ||
|
||
alloc_system = { path = "./alloc_system" } | ||
|
||
[patch.crates-io] | ||
rustc-std-workspace-core = { path = "./sysroot_src/src/tools/rustc-std-workspace-core" } | ||
compiler_builtins = { path = "./compiler_builtins" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
authors = ["The Rust Project Developers", "bjorn3 (edited to be usable outside the rust source)"] | ||
name = "alloc_system" | ||
version = "0.0.0" | ||
[lib] | ||
name = "alloc_system" | ||
path = "lib.rs" | ||
test = false | ||
doc = false | ||
[dependencies] | ||
core = { path = "../sysroot_src/src/libcore" } | ||
libc = { version = "0.2.43", features = ['rustc-dep-of-std'], default-features = false } | ||
compiler_builtins = "0.1" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -e | ||
cd $(dirname "$0") | ||
|
||
# Cleanup for previous run | ||
cargo clean | ||
rm Cargo.lock 2>/dev/null || true | ||
rm -r sysroot 2>/dev/null || true | ||
|
||
# FIXME find a better way to get the target triple | ||
unamestr=`uname` | ||
if [[ "$unamestr" == 'Linux' ]]; then | ||
TARGET_TRIPLE='x86_64-unknown-linux-gnu' | ||
elif [[ "$unamestr" == 'Darwin' ]]; then | ||
TARGET_TRIPLE='x86_64-apple-darwin' | ||
else | ||
echo "Unsupported os" | ||
exit 1 | ||
fi | ||
|
||
# Build libs | ||
export RUSTFLAGS="$RUSTFLAGS -Z force-unstable-if-unmarked --sysroot ../" | ||
if [[ "$1" == "--release" ]]; then | ||
channel='release' | ||
RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release | ||
else | ||
channel='debug' | ||
cargo build --target $TARGET_TRIPLE | ||
fi | ||
|
||
# Copy files to sysroot | ||
mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/ | ||
cp target/$TARGET_TRIPLE/$channel/deps/*.rlib sysroot/lib/rustlib/$TARGET_TRIPLE/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "compiler_builtins" | ||
# Make sure the `compiler_builtins` from crates.io doesn't take precedence over this | ||
# replacement by specifying a higher version than the one on crates.io. | ||
version = "0.1.100" | ||
authors = ["bjorn3 <[email protected]>"] | ||
edition = "2018" | ||
|
||
[lib] | ||
name = "compiler_builtins" | ||
path = "lib.rs" | ||
test = false | ||
doc = false | ||
|
||
[dependencies] | ||
core = { path = "../sysroot_src/src/libcore" } | ||
|
||
[features] | ||
rustc-dep-of-std = [] | ||
c = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#![feature(compiler_builtins)] | ||
#![compiler_builtins] | ||
#![no_std] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#![no_std] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash --verbose | ||
set -e | ||
|
||
rm -rf target/ build_sysroot/{sysroot/,sysroot_src/,target/,Cargo.lock} perf.data{,.old} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash --verbose | ||
set -e | ||
|
||
rustup component add rust-src | ||
./build_sysroot/prepare_sysroot_src.sh | ||
cargo install hyperfine || echo "Skipping hyperfine install" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.