A bunch of tiny fixes

This commit is contained in:
Ciro Santilli
2018-03-12 04:37:46 +00:00
parent b8413532a5
commit 77d2e0a8a5
6 changed files with 26 additions and 17 deletions

View File

@@ -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?

View File

@@ -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