about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/config.sh
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2023-10-26 17:42:02 -0400
committerAntoni Boucher <bouanto@zoho.com>2023-10-26 17:42:02 -0400
commitc797cccda61e1116fa4a2e8feb0fb43432add599 (patch)
tree0c135dadf0e67d118d77ddb06e449d0014f6f22a /compiler/rustc_codegen_gcc/config.sh
parent8396efecf7d30ca9f7edcf76aba2ea388300f6ab (diff)
parente4fe941b11a55c5005630696e9b6d81c65f7bd04 (diff)
downloadrust-c797cccda61e1116fa4a2e8feb0fb43432add599.tar.gz
rust-c797cccda61e1116fa4a2e8feb0fb43432add599.zip
Merge commit 'e4fe941b11a55c5005630696e9b6d81c65f7bd04' into subtree-update_cg_gcc_2023-10-25
Diffstat (limited to 'compiler/rustc_codegen_gcc/config.sh')
-rw-r--r--compiler/rustc_codegen_gcc/config.sh25
1 files changed, 12 insertions, 13 deletions
diff --git a/compiler/rustc_codegen_gcc/config.sh b/compiler/rustc_codegen_gcc/config.sh
index c686df0c72a..99ee9b054c6 100644
--- a/compiler/rustc_codegen_gcc/config.sh
+++ b/compiler/rustc_codegen_gcc/config.sh
@@ -20,22 +20,21 @@ else
 fi
 
 HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
-TARGET_TRIPLE=$HOST_TRIPLE
-#TARGET_TRIPLE="m68k-unknown-linux-gnu"
+# TODO: remove $OVERWRITE_TARGET_TRIPLE when config.sh is removed.
+TARGET_TRIPLE="${OVERWRITE_TARGET_TRIPLE:-$HOST_TRIPLE}"
 
 linker=''
 RUN_WRAPPER=''
 if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
-   if [[ "$TARGET_TRIPLE" == "m68k-unknown-linux-gnu" ]]; then
-       TARGET_TRIPLE="mips-unknown-linux-gnu"
-       linker='-Clinker=m68k-linux-gcc'
-   elif [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
-      # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.
-      linker='-Clinker=aarch64-linux-gnu-gcc'
-      RUN_WRAPPER='qemu-aarch64 -L /usr/aarch64-linux-gnu'
-   else
-      echo "Unknown non-native platform"
-   fi
+    RUN_WRAPPER=run_in_vm
+    if [[ "$TARGET_TRIPLE" == "m68k-unknown-linux-gnu" ]]; then
+        linker='-Clinker=m68k-unknown-linux-gnu-gcc'
+    elif [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then
+        # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.
+        linker='-Clinker=aarch64-linux-gnu-gcc'
+    else
+        echo "Unknown non-native platform"
+    fi
 fi
 
 # Since we don't support ThinLTO, disable LTO completely when not trying to do LTO.
@@ -60,4 +59,4 @@ export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
 # NOTE: To avoid the -fno-inline errors, use /opt/gcc/bin/gcc instead of cc.
 # To do so, add a symlink for cc to /opt/gcc/bin/gcc in our PATH.
 # Another option would be to add the following Rust flag: -Clinker=/opt/gcc/bin/gcc
-export PATH="/opt/gcc/bin:$PATH"
+export PATH="/opt/gcc/bin:/opt/m68k-unknown-linux-gnu/bin:$PATH"