diff --git a/build.sh b/build.sh index 245fc7cea3ec..ff3405aa8da7 100755 --- a/build.sh +++ b/build.sh @@ -53,7 +53,8 @@ else cargo build fi -RUSTC="rustc -Zcodegen-backend=$(pwd)/target/$channel/librustc_codegen_cranelift.$dylib_ext -Cpanic=abort -L crate=target/out --out-dir target/out" +export RUSTFLAGS='-Zalways-encode-mir -Cpanic=abort -Zcodegen-backend='$(pwd)'/target/'$channel'/librustc_codegen_cranelift.'$dylib_ext +RUSTC="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out" rm -r target/out || true mkdir -p target/out/clif @@ -71,5 +72,13 @@ build_example_bin mini_core_hello_world example/mini_core_hello_world.rs echo "[BUILD] core" time $RUSTC target/libcore/src/libcore/lib.rs --crate-type lib --crate-name core -Cincremental=target/incremental_core + +pushd xargo +rm -r ~/.xargo/HOST +export XARGO_RUST_SRC=$(pwd)'/../target/libcore/src' +time xargo build --color always +rm -r target/ +popd + cat target/out/log.txt | sort | uniq -c #extract_data libcore.rlib core.o diff --git a/xargo/Cargo.lock b/xargo/Cargo.lock new file mode 100644 index 000000000000..6bcf3b8bc528 --- /dev/null +++ b/xargo/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "xargo" +version = "0.1.0" + diff --git a/xargo/Cargo.toml b/xargo/Cargo.toml new file mode 100644 index 000000000000..9498cce26287 --- /dev/null +++ b/xargo/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "xargo" +version = "0.1.0" +authors = ["bjorn3 "] + +[dependencies] diff --git a/xargo/Xargo.toml b/xargo/Xargo.toml new file mode 100644 index 000000000000..51f6c78ea2b0 --- /dev/null +++ b/xargo/Xargo.toml @@ -0,0 +1,9 @@ +[dependencies] +core = {} + +# Disabled due to bug in current cranelift version, fixed in master +#alloc = {} +#alloc_system = {} + +# Disabled due to missing support for many things (intrinsics, etc) in rustc_codegen_cranelift +#std = {features = ["force_alloc_system"]} diff --git a/xargo/src/lib.rs b/xargo/src/lib.rs new file mode 100644 index 000000000000..1b5eb57bb460 --- /dev/null +++ b/xargo/src/lib.rs @@ -0,0 +1,5 @@ +#![feature(compiler_builtins)] + +#![no_std] +#![compiler_builtins] // Don't link to compiler builtins +// Just a dummy