aboutsummaryrefslogtreecommitdiff
path: root/tools/test.sh
diff options
context:
space:
mode:
authorAntonio Terceiro <[email protected]>2025-02-23 09:48:21 -0300
committerQuentin Carbonneaux <[email protected]>2025-03-15 14:40:55 +0100
commit789e38fdb238cfb0b09589e3cf361ca6df55d996 (patch)
tree38a03ececda257a8ce07366e61147327004b24fd /tools/test.sh
parent86d13b93e85ad9c11ae453529ab7b33896f39dd0 (diff)
Makefile: add explicit target to test the x86_64 backend
When developing on an arm64 machine, it's useful to be able to test the x86_64 target.
Diffstat (limited to 'tools/test.sh')
-rwxr-xr-xtools/test.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/test.sh b/tools/test.sh
index 23c6663..0eb6593 100755
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -62,6 +62,30 @@ init() {
fi
bin="$bin -t rv64"
;;
+ x86_64)
+ for p in x86_64-linux-musl x86_64-linux-gnu
+ do
+ cc="$p-gcc -no-pie -static"
+ qemu="qemu-x86_64"
+ if
+ $cc -v >/dev/null 2>&1 &&
+ $qemu -version >/dev/null 2>&1
+ then
+ if sysroot=$($cc -print-sysroot) && test -n "$sysroot"
+ then
+ qemu="$qemu -L $sysroot"
+ fi
+ break
+ fi
+ cc=
+ done
+ if test -z "$cc"
+ then
+ echo "Cannot find x86_64 compiler or qemu."
+ exit 1
+ fi
+ bin="$bin -t amd64_sysv"
+ ;;
"")
case `uname` in
*Darwin*)