common: one char arch shorthands, fail nicely on invalid arch

This commit is contained in:
Ciro Santilli
2018-05-03 16:11:16 +01:00
parent b8f190cc24
commit 1b0c527848
2 changed files with 32 additions and 1 deletions

View File

@@ -1630,7 +1630,7 @@ which automatically finds unstripped shared libraries on the host for us.
See also: https://stackoverflow.com/questions/8611194/debugging-shared-libraries-with-gdbserver/45252113#45252113
== Architectures
== CPU architecture
The portability of the kernel and toolchains is amazing: change an option and most things magically work on completely different hardware.
@@ -1649,6 +1649,19 @@ Debug:
./rungdb -a arm
....
We also have one letter shorthand names for the architectures:
....
# aarch64
./run -a A
# arm
./run -a a
# mips64
./run -a m
# x86_64
./run -a x
....
Known quirks of the supported architectures are documented in this section.
=== mips64

18
common
View File

@@ -22,6 +22,24 @@ common_bench_cmd() (
set_common_vars() {
arch="$1"
gem5="${2:-false}"
case "$arch" in
a|arm)
arch=arm
;;
A|aarch64)
arch=aarch64
;;
m|mips64)
arch=mips64
;;
x|x86_64)
arch=x86_64
;;
*)
printf "unknown arch: ${arch}\n" 1>&2
exit 2
;;
esac
common_suffix="${3:-}"
buildroot_dir="${root_dir}/buildroot"
arch_dir="$arch"