diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-07-31 14:04:00 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-08-09 12:46:24 +0200 |
| commit | dbac2192072a2a8b964be9858d06570da1cc86ba (patch) | |
| tree | a18accdd35d99386e9d2b8c8fab974230660095e /build_sysroot | |
| parent | e7a507863c281d571995e10f1e97beca42cb89ac (diff) | |
| download | rust-dbac2192072a2a8b964be9858d06570da1cc86ba.tar.gz rust-dbac2192072a2a8b964be9858d06570da1cc86ba.zip | |
Libtest support
Diffstat (limited to 'build_sysroot')
| -rw-r--r-- | build_sysroot/Cargo.toml | 2 | ||||
| -rwxr-xr-x | build_sysroot/build_sysroot.sh | 14 |
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/ |
