diff options
author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-09-13 16:49:39 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@dabbelt.com> | 2017-09-13 16:49:39 -0700 |
commit | 959536e4ff2a8f41e920c439616369e8849d1656 (patch) | |
tree | d8d62c445162e728c17434dd1787b3226bbae2f0 /scripts | |
parent | 23e0cd0ad00a7a03215a16ab53bfd34e75901d66 (diff) | |
download | riscv-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-x | scripts/wrapper/qemu/riscv64-unknown-linux-gnu-run | 14 |
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} "$@" |