mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
A bunch of tiny fixes
This commit is contained in:
16
gem5/build
16
gem5/build
@@ -1,12 +1,16 @@
|
||||
#/usr/bin/env bash
|
||||
set -eu
|
||||
arch=x86_64
|
||||
cross_compile=''
|
||||
j=''
|
||||
while getopts a:j: OPT; do
|
||||
while getopts a:c:j: OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch="$OPTARG"
|
||||
;;
|
||||
c)
|
||||
cross_compile="CROSS_COMPILE=$OPTARG"
|
||||
;;
|
||||
j)
|
||||
j="$OPTARG"
|
||||
;;
|
||||
@@ -22,6 +26,9 @@ binaries_dir="${system_dir}/binaries"
|
||||
disks_dir="${system_dir}/disks"
|
||||
mkdir -p "$binaries_dir" "$disks_dir"
|
||||
cd "${top}/gem5"
|
||||
|
||||
TARGET_CROSS=
|
||||
|
||||
if [ "$arch" = x86_64 ]; then
|
||||
CC=gcc-6 CXX=g++-6 scons -j"$j" --ignore-style build/X86/gem5.opt
|
||||
f="${disks_dir}/linux-bigswap2.img"
|
||||
@@ -34,11 +41,12 @@ 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"$j" --ignore-style build/ARM/gem5.opt
|
||||
make -C ./system/arm/dt
|
||||
make -C ./system/arm/dt/
|
||||
# TODO use the buildroot cross compiler here, and remove the dependencies from configure.
|
||||
make -C ./system/arm/simple_bootloader
|
||||
make -C ./system/arm/aarch64_bootloader/
|
||||
make -C ./system/arm/simple_bootloader/ $cross_compile
|
||||
cp ./system/arm/simple_bootloader/boot_emm.arm "$binaries_dir"
|
||||
# TODO cross_compile is ignored because the make does not use CC...
|
||||
make -C ./system/arm/aarch64_bootloader/ $cross_compile
|
||||
cp ./system/arm/aarch64_bootloader/boot_emm.arm64 "$binaries_dir"
|
||||
fi
|
||||
# TODO vs telnet?
|
||||
|
||||
@@ -15,7 +15,7 @@ ARCH_MAKE = $(ARCH)
|
||||
endif
|
||||
|
||||
define GEM5_BUILD_CMDS
|
||||
cd '$(@D)' && ./build -a '$(ARCH)' -j '$(BR2_JLEVEL)'
|
||||
cd '$(@D)' && ./build -a '$(ARCH)' -c '$(TARGET_CROSS)' -j '$(BR2_JLEVEL)'
|
||||
cd '$(@D)/gem5/util/m5' && $(MAKE) -f 'Makefile.$(ARCH_MAKE)' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
|
||||
endef
|
||||
|
||||
|
||||
Reference in New Issue
Block a user