mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
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.
This commit is contained in:
parent
86d13b93e8
commit
789e38fdb2
3
Makefile
3
Makefile
@ -71,6 +71,9 @@ clean-gen: clean
|
||||
check: qbe
|
||||
tools/test.sh all
|
||||
|
||||
check-x86_64: qbe
|
||||
TARGET=x86_64 tools/test.sh all
|
||||
|
||||
check-arm64: qbe
|
||||
TARGET=arm64 tools/test.sh all
|
||||
|
||||
|
||||
@ -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*)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user