summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-10-13 16:25:00 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-10-13 16:25:00 +0800
commitc1b32b6285367e641ddfa0d3dae54f5f16b8de66 (patch)
treeb70d3a2d44499291cbf2982cfaf602ccc0e6c8eb
parent48ebcbb06c1535de01ff8e27ce7d11d8cf9ffae8 (diff)
downloadmrust-c1b32b6285367e641ddfa0d3dae54f5f16b8de66.tar.gz
rustc bootstrap - 1.29 coming along
-rwxr-xr-xTestRustcBootstrap.sh18
-rw-r--r--run_rustc/Makefile6
2 files changed, 18 insertions, 6 deletions
diff --git a/TestRustcBootstrap.sh b/TestRustcBootstrap.sh
index 05897c59..3a1ecb1b 100755
--- a/TestRustcBootstrap.sh
+++ b/TestRustcBootstrap.sh
@@ -2,14 +2,15 @@
# Builds rustc with the mrustc stage0 and downloaded stage0
set -e
-PREFIX=${PWD}/run_rustc/prefix/
WORKDIR=${WORKDIR:-rustc_bootstrap}/
RUSTC_VERSION=${*-1.29.0}
+RUN_RUSTC_SUF=""
if [[ "$RUSTC_VERSION" == "1.29.0" ]]; then
RUSTC_VERSION_NEXT=1.30.0
elif [[ "$RUSTC_VERSION" == "1.19.0" ]]; then
RUSTC_VERSION_NEXT=1.20.0
+ RUN_RUSTC_SUF=-1.19.0
else
echo "Unknown rustc version"
fi
@@ -20,14 +21,18 @@ export MAKEFLAGS
echo "=== Building stage0 rustc (with libstd)"
make -C run_rustc RUSTC_VERSION=${RUSTC_VERSION}
+PREFIX=${PWD}/run_rustc/output${RUN_RUSTC_SUF}/prefix/
+
if [ ! -e rustc-${RUSTC_VERSION_NEXT}-src.tar.gz ]; then
wget https://static.rust-lang.org/dist/rustc-${RUSTC_VERSION_NEXT}-src.tar.gz
fi
+echo "--- Working in directory ${WORKDIR}"
+echo "=== Cleaning up"
+rm -rf ${WORKDIR}build
#
# Build rustc using entirely mrustc-built tools
#
-echo "--- Working in directory ${WORKDIR}"
echo "=== Building rustc bootstrap mrustc stage0"
mkdir -p ${WORKDIR}mrustc/
tar -xf rustc-${RUSTC_VERSION_NEXT}-src.tar.gz -C ${WORKDIR}mrustc/
@@ -40,8 +45,13 @@ vendor = true
EOF
echo "--- Running x.py, see ${WORKDIR}mrustc.log for progress"
(cd ${WORKDIR} && mv mrustc build)
-(cd ${WORKDIR}build/rustc-${RUSTC_VERSION_NEXT}-src/ && ./x.py build --stage 3) > ${WORKDIR}mrustc.log 2>&1
-(cd ${WORKDIR} && mv build mrustc)
+cleanup_mrustc() {
+ (cd ${WORKDIR} && mv build mrustc)
+}
+trap cleanup_mrustc EXIT
+(cd ${WORKDIR}build/rustc-${RUSTC_VERSION_NEXT}-src/ && LD_LIBRARY_PATH=${PREFIX}lib/rustlib/x86_64-unknown-linux-gnu/lib ./x.py build --stage 3) > ${WORKDIR}mrustc.log 2>&1
+cleanup_mrustc
+trap - EXIT
rm -rf ${WORKDIR}mrustc-output
cp -r ${WORKDIR}mrustc/rustc-${RUSTC_VERSION_NEXT}-src/build/x86_64-unknown-linux-gnu/stage2 ${WORKDIR}mrustc-output
tar -czf ${WORKDIR}mrustc.tar.gz -C ${WORKDIR} mrustc-output
diff --git a/run_rustc/Makefile b/run_rustc/Makefile
index b1dabe61..05981b47 100644
--- a/run_rustc/Makefile
+++ b/run_rustc/Makefile
@@ -62,12 +62,14 @@ $(LIBDIR)libstd.rlib: $(BINDIR_S)rustc $(BINDIR)cargo $(LIBDIR_S)libstd.rlib $(C
@mkdir -p $(OUTDIR)build-std
@echo [CARGO] $(RUST_SRC)libstd/Cargo.toml
$VRUSTC=$(BINDIR_S)rustc CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET) RUSTC_BOOTSTRAP=1 CARGO_HOME=$(CARGO_HOME) $(BINDIR)cargo build -Z unstable-options --manifest-path $(RUST_SRC)libstd/Cargo.toml --out-dir $(LIBDIR) --target-dir $(OUTDIR)build-std -j 1 --release --features panic-unwind
- cp $(OUTDIR)build-std/release/deps/lib*-*.rlib $(LIBDIR)
+ @cp --remove-destination $(OUTDIR)build-std/release/deps/lib*-*.rlib $(LIBDIR)
#cp $(OUTDIR)build-std/release/deps/lib*-*.so $(LIBDIR)
$(LIBDIR)libproc_macro.rlib: $(LIBDIR)libstd.rlib $(CARGO_HOME)config
@mkdir -p $(OUTDIR)build-pm
@echo [CARGO] $(RUST_SRC)libproc_macro/Cargo.toml
- $VRUSTC=$(BINDIR)rustc RUSTC_ERROR_METADATA_DST=$(abspath $(PREFIX)) CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET) RUSTC_BOOTSTRAP=1 CARGO_HOME=$(CARGO_HOME) $(BINDIR)cargo build -Z unstable-options --manifest-path $(RUST_SRC)libproc_macro/Cargo.toml --out-dir $(LIBDIR) --target-dir $(OUTDIR)build-pm -j 1 --verbose
+ $VRUSTC=$(BINDIR)rustc RUSTC_ERROR_METADATA_DST=$(abspath $(PREFIX)) CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET) RUSTFLAGS="-Z force-unstable-if-unmarked" RUSTC_BOOTSTRAP=1 CARGO_HOME=$(CARGO_HOME) $(BINDIR)cargo build -Z unstable-options --manifest-path $(RUST_SRC)libproc_macro/Cargo.toml --out-dir $(LIBDIR) --target-dir $(OUTDIR)build-pm --release -j 1
+ @cp --remove-destination $(OUTDIR)build-pm/release/deps/lib*.so $(LIBDIR)
+ @cp --remove-destination $(OUTDIR)build-pm/release/deps/lib*.rlib $(LIBDIR)
$(BINDIR)hello_world: $(RUST_SRC)test/run-pass/hello.rs $(LIBDIR)libstd.rlib $(BINDIR)rustc
@mkdir -p $(dir $@)