]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/config.sh
Auto merge of #76345 - okready:sgx-mem-range-overflow-checks, r=joshtriplett
[rust.git] / compiler / rustc_codegen_cranelift / scripts / config.sh
1 # Note to people running shellcheck: this file should only be sourced, not executed directly.
2
3 set -e
4
5 unamestr=$(uname)
6 if [[ "$unamestr" == 'Linux' ]]; then
7    dylib_ext='so'
8 elif [[ "$unamestr" == 'Darwin' ]]; then
9    dylib_ext='dylib'
10 else
11    echo "Unsupported os"
12    exit 1
13 fi
14
15 if echo "$RUSTC_WRAPPER" | grep sccache; then
16 echo
17 echo -e "\x1b[1;93m=== Warning: Unset RUSTC_WRAPPER to prevent interference with sccache ===\x1b[0m"
18 echo
19 export RUSTC_WRAPPER=
20 fi
21
22 dir=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)
23
24 export RUSTC=$dir"/bin/cg_clif"
25
26 export RUSTDOCFLAGS=$linker' -Cpanic=abort -Zpanic-abort-tests '\
27 '-Zcodegen-backend='$dir'/lib/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$dir
28
29 # FIXME remove once the atomic shim is gone
30 if [[ "$unamestr" == 'Darwin' ]]; then
31    export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
32 fi
33
34 export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib:"$dir"/lib"
35 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH