aboutsummaryrefslogtreecommitdiff
path: root/scripts/wrapper/qemu/riscv64-unknown-linux-gnu-run
blob: 078360e0d5afba8169c0d21dab4e11dc186462df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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_CPU=${QEMU_CPU} qemu-riscv$xlen -r 5.10 "${qemu_args[@]}" -L ${RISC_V_SYSROOT} "$@"