mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
gem5: support variants
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
set -eux
|
||||
arch=x86_64
|
||||
cross_compile=
|
||||
j=
|
||||
outdir="$(pwd)/out"
|
||||
outdir="$(pwd)"
|
||||
while getopts a:c:j:o: OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
@@ -28,7 +28,6 @@ system_dir="${outdir}/system"
|
||||
binaries_dir="${system_dir}/binaries"
|
||||
disks_dir="${system_dir}/disks"
|
||||
mkdir -p "$binaries_dir" "$disks_dir"
|
||||
cd "gem5"
|
||||
if [ "$arch" = x86_64 ]; then
|
||||
scons -j "$j" --ignore-style "${outdir}/build/X86/gem5.opt"
|
||||
f="${disks_dir}/linux-bigswap2.img"
|
||||
@@ -41,7 +40,8 @@ elif [ "$arch" = arm ] || [ "$arch" = aarch64 ]; then
|
||||
scons -j "$j" --ignore-style "${outdir}/build/ARM/gem5.opt"
|
||||
make -C ./system/arm/dt/
|
||||
mkdir -p "${system_dir}/arm/dt"
|
||||
cp ./system/arm/dt/*.dtb "${system_dir}/arm/dt"
|
||||
# || true in case they are the same directory.
|
||||
cp ./system/arm/dt/*.dtb "${system_dir}/arm/dt" || true
|
||||
# TODO use the buildroot cross compiler here, and remove the dependencies from configure.
|
||||
make -C ./system/arm/simple_bootloader/ $cross_compile
|
||||
cp ./system/arm/simple_bootloader/boot_emm.arm "$binaries_dir"
|
||||
|
||||
@@ -15,10 +15,8 @@ ARCH_MAKE = $(ARCH)
|
||||
endif
|
||||
|
||||
define GEM5_BUILD_CMDS
|
||||
# Cannot pass "-c '$(TARGET_CROSS)'" here because the ARM build uses aarch64 for the bootloader...
|
||||
cd '$(GEM5_SITE)' && ./build -a '$(ARCH)' -j '$(BR2_JLEVEL)' -o '$(GEM5_SITE)/../out/common/gem5'
|
||||
# This would build inside the buildroot directory as a more normal package.
|
||||
#cd '$(@D)' && ./build -a '$(ARCH)' -j '$(BR2_JLEVEL)'
|
||||
# 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)'
|
||||
|
||||
# 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