-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgo-build
executable file
·31 lines (23 loc) · 884 Bytes
/
go-build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -e
export EXTRA_MAKE_OPTS=-j8
echo "********** Build mrustc and rustc stage 0"
(cd mrustc && ln -sf ../rust rustc-1.19.0-src)
(cd mrustc && MAKEFLAGS=-j8 make -f minicargo.mk bin/mrustc) > mrustc.log
(cd mrustc && make -j8 -f minicargo.mk output/rustc) > rustc-mrustc.log
(cd mrustc && make -f minicargo.mk output/cargo) > cargo-mrustc.log
echo "********** Build stage 0 std lib"
(cd mrustc/run_rustc && make) > rustc-mrustc-std.log
rm -rf stage0
mkdir -p stage0/bin
mkdir -p stage0/lib64/rustlib/x86_64-unknown-linux-gnu/lib/lib
cp mrustc/output/{rustc,cargo} stage0/bin
cp -a mrustc/run_rustc/prefix/lib/* stage0/lib64/rustlib/x86_64-unknown-linux-gnu/lib
echo "********** Build rustc"
cat <<EOF > rust/config.toml
[build]
rustc = "$PWD/stage0/bin/rustc"
cargo = "$PWD/stage0/bin/cargo"
vendor = true
EOF
(cd rust && ./x.py --verbose build) |& tee rustc.log