]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_codegen_cranelift/scripts/ext_config.sh
New upstream version 1.62.1+dfsg1
[rustc.git] / compiler / rustc_codegen_cranelift / scripts / ext_config.sh
CommitLineData
5869c6ff
XL
1# Note to people running shellcheck: this file should only be sourced, not executed directly.
2
136023e0 3# Various env vars that should only be set for the build system
5869c6ff
XL
4
5set -e
6
7export CG_CLIF_DISPLAY_CG_TIME=1
17df50a5 8export CG_CLIF_DISABLE_INCR_CACHE=1
5869c6ff
XL
9
10export HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
11export TARGET_TRIPLE=${TARGET_TRIPLE:-$HOST_TRIPLE}
12
13export RUN_WRAPPER=''
14export JIT_SUPPORTED=1
15if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
16 export JIT_SUPPORTED=0
17 if [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
18 # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.
19 export RUSTFLAGS='-Clinker=aarch64-linux-gnu-gcc '$RUSTFLAGS
20 export RUN_WRAPPER='qemu-aarch64 -L /usr/aarch64-linux-gnu'
21 elif [[ "$TARGET_TRIPLE" == "x86_64-pc-windows-gnu" ]]; then
22 # We are cross-compiling for Windows. Run tests in wine.
23 export RUN_WRAPPER='wine'
24 else
25 echo "Unknown non-native platform"
26 fi
27fi
136023e0
XL
28
29# FIXME fix `#[linkage = "extern_weak"]` without this
30if [[ "$(uname)" == 'Darwin' ]]; then
31 export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
32fi