diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-02-13 19:36:36 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-04-29 19:07:29 +0200 |
| commit | 377f44d38c0ee788860df1f8edf02d7eefbe0160 (patch) | |
| tree | 1c0e6f7ea906264b99c4b7bf48de421464162793 /scripts | |
| parent | 944a48d3afb0fa27390ecbd2ceb0f1c666cf4c5b (diff) | |
| download | rust-377f44d38c0ee788860df1f8edf02d7eefbe0160.tar.gz rust-377f44d38c0ee788860df1f8edf02d7eefbe0160.zip | |
Inline ext_config.sh
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/ext_config.sh | 32 | ||||
| -rwxr-xr-x | scripts/tests.sh | 29 |
2 files changed, 28 insertions, 33 deletions
diff --git a/scripts/ext_config.sh b/scripts/ext_config.sh deleted file mode 100644 index 11d6c4c8318..00000000000 --- a/scripts/ext_config.sh +++ /dev/null @@ -1,32 +0,0 @@ -# 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 - -set -e - -export CG_CLIF_DISPLAY_CG_TIME=1 -export CG_CLIF_DISABLE_INCR_CACHE=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 - -# FIXME fix `#[linkage = "extern_weak"]` without this -if [[ "$(uname)" == 'Darwin' ]]; then - export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup" -fi diff --git a/scripts/tests.sh b/scripts/tests.sh index 938553ceab0..cdde44ac67c 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -3,7 +3,34 @@ set -e source scripts/config.sh -source scripts/ext_config.sh + +export CG_CLIF_DISPLAY_CG_TIME=1 +export CG_CLIF_DISABLE_INCR_CACHE=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 + +# FIXME fix `#[linkage = "extern_weak"]` without this +if [[ "$(uname)" == 'Darwin' ]]; then + export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup" +fi + export RUSTC=false # ensure that cg_llvm isn't accidentally used MY_RUSTC="$(pwd)/build/bin/cg_clif $RUSTFLAGS -L crate=target/out --out-dir target/out -Cdebuginfo=2" |
