diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-02-01 10:11:46 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-02-01 10:11:46 +0100 |
| commit | a75f9bc3be1d9488de2d13e4afbf724ffadfc70f (patch) | |
| tree | cad2e5a8fe6635c92a496921493d5bdc3e28c19f /scripts/ext_config.sh | |
| parent | e67b72de2e9c4de59c68f2ad7f0ab117d2446c9e (diff) | |
Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01
Diffstat (limited to 'scripts/ext_config.sh')
| -rw-r--r-- | scripts/ext_config.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/ext_config.sh b/scripts/ext_config.sh new file mode 100644 index 00000000000..7971f620df1 --- /dev/null +++ b/scripts/ext_config.sh @@ -0,0 +1,27 @@ +# Note to people running shellcheck: this file should only be sourced, not executed directly. + +# Various env vars that should only be set for the build system but not for cargo.sh + +set -e + +export CG_CLIF_DISPLAY_CG_TIME=1 +export CG_CLIF_INCR_CACHE_DISABLED=1 + +export HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ") +export TARGET_TRIPLE=${TARGET_TRIPLE:-$HOST_TRIPLE} + +export RUN_WRAPPER='' +export JIT_SUPPORTED=1 +if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then + export JIT_SUPPORTED=0 + if [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then + # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu. + export RUSTFLAGS='-Clinker=aarch64-linux-gnu-gcc '$RUSTFLAGS + export RUN_WRAPPER='qemu-aarch64 -L /usr/aarch64-linux-gnu' + elif [[ "$TARGET_TRIPLE" == "x86_64-pc-windows-gnu" ]]; then + # We are cross-compiling for Windows. Run tests in wine. + export RUN_WRAPPER='wine' + else + echo "Unknown non-native platform" + fi +fi |
