mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Build gem5 through buildroot
Oh, btw, also make it work, since the build was completely broken since the recent -K refactoring :0)
This commit is contained in:
37
build-gem5
37
build-gem5
@@ -1,37 +0,0 @@
|
||||
#/usr/bin/env bash
|
||||
set -eu
|
||||
arch=x86_64
|
||||
while getopts 'a:' OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch="$OPTARG"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift "$(($OPTIND - 1))"
|
||||
top="$(pwd)/gem5"
|
||||
system_dir="${top}/gem5-system"
|
||||
binaries_dir="${system_dir}/binaries"
|
||||
disks_dir="${system_dir}/disks"
|
||||
mkdir -p "$binaries_dir" "$disks_dir"
|
||||
cd "${top}/gem5"
|
||||
if [ "$arch" = x86_64 ]; then
|
||||
CC=gcc-6 CXX=g++-6 scons -j"$(nproc)" --ignore-style build/X86/gem5.opt
|
||||
f="${disks_dir}/linux-bigswap2.img"
|
||||
dd if=/dev/zero of="$f" bs=1024 count=65536
|
||||
mkswap "$f"
|
||||
# This file must always be present, despite --kernel overriding that default and selecting the kernel.
|
||||
# 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
|
||||
# Compilation fails with gcc 7 on that commit.
|
||||
# There were some recent portability patches, so it will likely get there soon.
|
||||
CC=gcc-6 CXX=g++-6 scons -j"$(nproc)" --ignore-style build/ARM/gem5.opt
|
||||
make -C system/arm/dt
|
||||
make -C system/arm/simple_bootloader
|
||||
make -C system/arm/aarch64_bootloader/
|
||||
cp ./system/arm/simple_bootloader/boot_emm.arm "$binaries_dir"
|
||||
cp ./system/arm/aarch64_bootloader/boot_emm.arm64 "$binaries_dir"
|
||||
fi
|
||||
# TODO vs telnet?
|
||||
make -C util/term
|
||||
Reference in New Issue
Block a user