aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2017-09-13 16:49:39 -0700
committerPalmer Dabbelt <palmer@dabbelt.com>2017-09-13 16:49:39 -0700
commit959536e4ff2a8f41e920c439616369e8849d1656 (patch)
treed8d62c445162e728c17434dd1787b3226bbae2f0 /scripts
parent23e0cd0ad00a7a03215a16ab53bfd34e75901d66 (diff)
downloadriscv-gnu-toolchain-959536e4ff2a8f41e920c439616369e8849d1656.zip
riscv-gnu-toolchain-959536e4ff2a8f41e920c439616369e8849d1656.tar.gz
riscv-gnu-toolchain-959536e4ff2a8f41e920c439616369e8849d1656.tar.bz2
Allow tests to pass special QEMU arguments
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/wrapper/qemu/riscv64-unknown-linux-gnu-run14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/wrapper/qemu/riscv64-unknown-linux-gnu-run b/scripts/wrapper/qemu/riscv64-unknown-linux-gnu-run
index 7aad5ea..439164c 100755
--- a/scripts/wrapper/qemu/riscv64-unknown-linux-gnu-run
+++ b/scripts/wrapper/qemu/riscv64-unknown-linux-gnu-run
@@ -1,3 +1,15 @@
+#!/bin/bash
+
+qemu_args=()
+while [[ "$1" != "" ]]
+do
+ case "$1" in
+ -Wq,*) qemu_args+=("$(echo "$1" | cut -d, -f2-)");;
+ *) break;;
+ esac
+ shift
+done
+
xlen="$(readelf -h $1 | grep 'Class' | cut -d: -f 2 | xargs echo | sed 's/^ELF//')"
-qemu-riscv$xlen -L ${RISC_V_SYSROOT} "$@"
+qemu-riscv$xlen "${qemu_args[@]}" -L ${RISC_V_SYSROOT} "$@"