Merge pull request #709 from ucb-bar/small-backwards-compat

Bump Dromajo | Optional ignore QEMU toolchain flag
This commit is contained in:
Abraham Gonzalez
2020-11-15 14:07:31 -08:00
committed by GitHub
2 changed files with 18 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ usage() {
echo "Options" echo "Options"
echo " --prefix PREFIX : Install destination. If unset, defaults to $(pwd)/riscv-tools-install" echo " --prefix PREFIX : Install destination. If unset, defaults to $(pwd)/riscv-tools-install"
echo " or $(pwd)/esp-tools-install" echo " or $(pwd)/esp-tools-install"
echo " --ignore-qemu : Ignore installing QEMU"
echo " --help -h : Display this message" echo " --help -h : Display this message"
exit "$1" exit "$1"
} }
@@ -34,6 +35,7 @@ die() {
TOOLCHAIN="riscv-tools" TOOLCHAIN="riscv-tools"
EC2FASTINSTALL="false" EC2FASTINSTALL="false"
IGNOREQEMU=""
RISCV="" RISCV=""
# getopts does not support long options, and is inflexible # getopts does not support long options, and is inflexible
@@ -45,6 +47,9 @@ do
-p | --prefix ) -p | --prefix )
shift shift
RISCV=$(realpath $1) ;; RISCV=$(realpath $1) ;;
--ignore-qemu )
shift
IGNOREQEMU="true" ;;
riscv-tools | esp-tools) riscv-tools | esp-tools)
TOOLCHAIN=$1 ;; TOOLCHAIN=$1 ;;
ec2fast ) ec2fast )
@@ -102,12 +107,16 @@ if [ "${EC2FASTINSTALL}" = true ] ; then
git submodule deinit "${module}" || : git submodule deinit "${module}" || :
else else
"${MAKE}" --version | ( MAKE_VER=$("${MAKE}" --version) || true
read -r makever case ${MAKE_VER} in
case ${makever} in 'GNU Make '[4-9]\.*)
'GNU Make '[4-9]\.*|'GNU Make '[1-9][0-9]) ;; ;;
*) false ;; 'GNU Make '[1-9][0-9])
esac; ) || die 'obsolete make version; need GNU make 4.x or later' ;;
*)
die 'obsolete make version; need GNU make 4.x or later'
;;
esac
module_prepare riscv-gnu-toolchain qemu module_prepare riscv-gnu-toolchain qemu
module_build riscv-gnu-toolchain --prefix="${RISCV}" --with-cmodel=medany module_build riscv-gnu-toolchain --prefix="${RISCV}" --with-cmodel=medany
@@ -128,7 +137,9 @@ module_all riscv-tests --prefix="${RISCV}/riscv64-unknown-elf"
SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv64-unknown-elf" --host=riscv64-unknown-elf SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv64-unknown-elf" --host=riscv64-unknown-elf
if [ -z "$IGNOREQEMU" ] ; then
SRCDIR="$(pwd)/toolchains" module_all qemu --prefix="${RISCV}" --target-list=riscv64-softmmu SRCDIR="$(pwd)/toolchains" module_all qemu --prefix="${RISCV}" --target-list=riscv64-softmmu
fi
# make Dromajo # make Dromajo
git submodule update --init $CHIPYARD_DIR/tools/dromajo/dromajo-src git submodule update --init $CHIPYARD_DIR/tools/dromajo/dromajo-src