]> git.lizzy.rs Git - rust.git/blob - build.sh
Auto merge of #89652 - rcvalle:rust-cfi, r=nagisa
[rust.git] / build.sh
1 #!/bin/bash
2
3 #set -x
4 set -e
5
6 if [ -f ./gcc_path ]; then 
7     export GCC_PATH=$(cat gcc_path)
8 else
9     echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
10     exit 1
11 fi
12
13 export LD_LIBRARY_PATH="$GCC_PATH"
14 export LIBRARY_PATH="$GCC_PATH"
15
16 if [[ "$1" == "--release" ]]; then
17     export CHANNEL='release'
18     CARGO_INCREMENTAL=1 cargo rustc --release
19 else
20     echo $LD_LIBRARY_PATH
21     export CHANNEL='debug'
22     cargo rustc
23 fi
24
25 source config.sh
26
27 rm -r target/out || true
28 mkdir -p target/out/gccjit
29
30 echo "[BUILD] sysroot"
31 time ./build_sysroot/build_sysroot.sh $CHANNEL