summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-03-16 18:21:08 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2021-03-18 12:11:35 +0100
commit097dc86c45cc2f20cf98ec0385dbb57aaba419ec (patch)
tree14a3cb40edaae5bc1efcd19cde45b9e402cfcea1
parent0678bee5788acd08d62219f4fc857589e2703197 (diff)
downloadroux-097dc86c45cc2f20cf98ec0385dbb57aaba419ec.tar.gz
use toolchain to determine aarch64 sysroot path
-rwxr-xr-xtools/test.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/test.sh b/tools/test.sh
index 937974b..b4e7470 100755
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -23,12 +23,15 @@ init() {
 		for p in aarch64-linux-musl aarch64-linux-gnu
 		do
 			cc="$p-gcc -no-pie"
-			qemu="qemu-aarch64 -L /usr/$p"
+			qemu="qemu-aarch64"
 			if
 				$cc -v >/dev/null 2>&1 &&
-				$qemu -version >/dev/null 2>&1 &&
-				test -d /usr/$p
+				$qemu -version >/dev/null 2>&1
 			then
+				if sysroot=$($cc -print-sysroot) && test -n "$sysroot"
+				then
+					qemu="$qemu -L $sysroot"
+				fi
 				break
 			fi
 			cc=