5 if [[ "$unamestr" == 'Linux' ]]; then
7 elif [[ "$unamestr" == 'Darwin' ]]; then
14 HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
15 TARGET_TRIPLE=$HOST_TRIPLE
16 #TARGET_TRIPLE="x86_64-pc-windows-gnu"
17 #TARGET_TRIPLE="aarch64-unknown-linux-gnu"
21 export JIT_SUPPORTED=1
22 if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
23 export JIT_SUPPORTED=0
24 if [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
25 # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.
26 linker='-Clinker=aarch64-linux-gnu-gcc'
27 RUN_WRAPPER='qemu-aarch64 -L /usr/aarch64-linux-gnu'
28 elif [[ "$TARGET_TRIPLE" == "x86_64-pc-windows-gnu" ]]; then
29 # We are cross-compiling for Windows. Run tests in wine.
32 echo "Unknown non-native platform"
36 if echo "$RUSTC_WRAPPER" | grep sccache; then
38 echo -e "\x1b[1;93m=== Warning: Unset RUSTC_WRAPPER to prevent interference with sccache ===\x1b[0m"
43 dir=$(cd $(dirname "$BASH_SOURCE"); pwd)
45 export RUSTC=$dir"/cg_clif"
46 export RUSTFLAGS=$linker
47 export RUSTDOCFLAGS=$linker' -Ztrim-diagnostic-paths=no -Cpanic=abort -Zpanic-abort-tests '\
48 '-Zcodegen-backend='$dir'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$dir'/sysroot'
50 # FIXME remove once the atomic shim is gone
51 if [[ `uname` == 'Darwin' ]]; then
52 export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
55 export LD_LIBRARY_PATH="$dir:$(rustc --print sysroot)/lib:$dir/target/out:$dir/sysroot/lib/rustlib/"$TARGET_TRIPLE"/lib"
56 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
58 export CG_CLIF_DISPLAY_CG_TIME=1