about summary refs log tree commit diff
path: root/build_sysroot
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2019-07-31 14:04:00 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2019-08-09 12:46:24 +0200
commitdbac2192072a2a8b964be9858d06570da1cc86ba (patch)
treea18accdd35d99386e9d2b8c8fab974230660095e /build_sysroot
parente7a507863c281d571995e10f1e97beca42cb89ac (diff)
downloadrust-dbac2192072a2a8b964be9858d06570da1cc86ba.tar.gz
rust-dbac2192072a2a8b964be9858d06570da1cc86ba.zip
Libtest support
Diffstat (limited to 'build_sysroot')
-rw-r--r--build_sysroot/Cargo.toml2
-rwxr-xr-xbuild_sysroot/build_sysroot.sh14
2 files changed, 14 insertions, 2 deletions
diff --git a/build_sysroot/Cargo.toml b/build_sysroot/Cargo.toml
index e7d90b730eb..7776f1bd383 100644
--- a/build_sysroot/Cargo.toml
+++ b/build_sysroot/Cargo.toml
@@ -7,7 +7,7 @@ version = "0.0.0"
 core = { path = "./sysroot_src/src/libcore" }
 compiler_builtins = "0.1"
 alloc = { path = "./sysroot_src/src/liballoc" }
-std = { path = "./sysroot_src/src/libstd" }
+std = { path = "./sysroot_src/src/libstd", features = ["panic_unwind"] }
 
 alloc_system = { path = "./alloc_system" }
 
diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh
index 165d67a8146..4e58858f133 100755
--- a/build_sysroot/build_sysroot.sh
+++ b/build_sysroot/build_sysroot.sh
@@ -12,7 +12,8 @@ popd >/dev/null
 # Cleanup for previous run
 #     v Clean target dir except for build scripts and incremental cache
 rm -r target/*/{debug,release}/{build,deps,examples,libsysroot*,native} || true
-rm Cargo.lock 2>/dev/null || true
+rm -r sysroot_src/src/{libcore,libtest}/target/$TARGET_TRIPLE/$sysroot_channel/ || true
+rm Cargo.lock test_target/Cargo.lock 2>/dev/null || true
 rm -r sysroot 2>/dev/null || true
 
 # Build libs
@@ -28,3 +29,14 @@ fi
 # Copy files to sysroot
 mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
 cp target/$TARGET_TRIPLE/$sysroot_channel/deps/*.rlib sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
+
+if [[ "$1" == "--release" ]]; then
+    channel='release'
+    RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release --manifest-path ./sysroot_src/src/libtest/Cargo.toml
+else
+    channel='debug'
+    cargo build --target $TARGET_TRIPLE --manifest-path ./sysroot_src/src/libtest/Cargo.toml
+fi
+
+# Copy files to sysroot
+cp sysroot_src/src/libtest/target/$TARGET_TRIPLE/$sysroot_channel/deps/*.rlib sysroot/lib/rustlib/$TARGET_TRIPLE/lib/