mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
gem5: track build and run variants separately with -M and -N
Otherwise, checking out branches is too insane, as it does not update the worktrees, even though the gem5/gem5 module was updated. gem5: expose build types, document debug builds. simultaneous runs: store stdout and stderr on a file to allow running all from a single terminal on the background cleanly.
This commit is contained in:
13
gem5/build
13
gem5/build
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eux
|
||||
arch=x86_64
|
||||
build_type=opt
|
||||
cross_compile=
|
||||
j=
|
||||
outdir="$(pwd)"
|
||||
while getopts a:c:j:o: OPT; do
|
||||
while getopts a:c:j:o:t: OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch="$OPTARG"
|
||||
@@ -18,6 +19,12 @@ while getopts a:c:j:o: OPT; do
|
||||
o)
|
||||
outdir="$OPTARG"
|
||||
;;
|
||||
t)
|
||||
build_type="$OPTARG"
|
||||
;;
|
||||
?)
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift "$(($OPTIND - 1))"
|
||||
@@ -30,7 +37,7 @@ disks_dir="${system_dir}/disks"
|
||||
mkdir -p "$binaries_dir" "$disks_dir"
|
||||
export PATH="/usr/lib/ccache:${PATH}"
|
||||
if [ "$arch" = x86_64 ]; then
|
||||
scons -j "$j" --ignore-style "${outdir}/build/X86/gem5.opt"
|
||||
scons -j "$j" --ignore-style "${outdir}/build/X86/gem5.${build_type}"
|
||||
f="${disks_dir}/linux-bigswap2.img"
|
||||
dd if=/dev/zero of="$f" bs=1024 count=65536
|
||||
mkswap "$f"
|
||||
@@ -38,7 +45,7 @@ if [ "$arch" = x86_64 ]; then
|
||||
# I'm not even joking. No one has ever built x86 gem5 without the magic dist dir present.
|
||||
touch "${binaries_dir}/x86_64-vmlinux-2.6.22.9"
|
||||
elif [ "$arch" = arm ] || [ "$arch" = aarch64 ]; then
|
||||
scons -j "$j" --ignore-style "${outdir}/build/ARM/gem5.opt"
|
||||
scons -j "$j" --ignore-style "${outdir}/build/ARM/gem5.${build_type}"
|
||||
make -C ./system/arm/dt/
|
||||
mkdir -p "${system_dir}/arm/dt"
|
||||
# || true in case they are the same directory.
|
||||
|
||||
@@ -16,7 +16,7 @@ endif
|
||||
|
||||
define GEM5_BUILD_CMDS
|
||||
# TODO cannot pass "-c '$(TARGET_CROSS)'" here because the ARM build uses aarch64 for the bootloader...
|
||||
cd '$(GEM5_LKMC_SRCDIR)' && '$(GEM5_SITE)/build' -a '$(ARCH)' -j '$(BR2_JLEVEL)' -o '$(GEM5_LKMC_OUTDIR)'
|
||||
cd '$(GEM5_LKMC_SRCDIR)' && '$(GEM5_SITE)/build' -a '$(ARCH)' -j '$(BR2_JLEVEL)' -o '$(GEM5_LKMC_OUTDIR)' -t '$(GEM5_LKMC_GEM5_BUILD_TYPE)'
|
||||
|
||||
# TODO cannot use TARGET_CONFIGURE_OPTS here because it overrides the CFLAGS on m5,
|
||||
# which have an include. We should patch gem5 to add a += instead of = there.
|
||||
|
||||
Reference in New Issue
Block a user