]>
git.proxmox.com Git - rustc.git/blob - compiler/rustc_codegen_cranelift/scripts/config.sh
1 # Note to people running shellcheck: this file should only be sourced, not executed directly.
6 if [[ "$unamestr" == 'Linux' ]]; then
8 elif [[ "$unamestr" == 'Darwin' ]]; then
15 HOST_TRIPLE
=$
(rustc
-vV |
grep host | cut
-d: -f2 |
tr -d " ")
16 TARGET_TRIPLE
=$HOST_TRIPLE
17 #TARGET_TRIPLE="x86_64-pc-windows-gnu"
18 #TARGET_TRIPLE="aarch64-unknown-linux-gnu"
22 export JIT_SUPPORTED
=1
23 if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
24 export JIT_SUPPORTED
=0
25 if [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
26 # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.
27 linker
='-Clinker=aarch64-linux-gnu-gcc'
28 RUN_WRAPPER
='qemu-aarch64 -L /usr/aarch64-linux-gnu'
29 elif [[ "$TARGET_TRIPLE" == "x86_64-pc-windows-gnu" ]]; then
30 # We are cross-compiling for Windows. Run tests in wine.
33 echo "Unknown non-native platform"
37 if echo "$RUSTC_WRAPPER" |
grep sccache
; then
39 echo -e "\x1b[1;93m=== Warning: Unset RUSTC_WRAPPER to prevent interference with sccache ===\x1b[0m"
44 dir
=$
(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)
46 export RUSTC
=$dir"/bin/cg_clif"
47 export RUSTFLAGS
=$linker" "$RUSTFLAGS
48 export RUSTDOCFLAGS
=$linker' -Cpanic=abort -Zpanic-abort-tests '\
49 '-Zcodegen-backend='$dir'/lib/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$dir
51 # FIXME remove once the atomic shim is gone
52 if [[ $
(uname
) == 'Darwin' ]]; then
53 export RUSTFLAGS
="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
56 export LD_LIBRARY_PATH
="$(rustc --print sysroot)/lib"
57 export DYLD_LIBRARY_PATH
=$LD_LIBRARY_PATH
59 export CG_CLIF_DISPLAY_CG_TIME
=1