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

@@ -1110,9 +1110,9 @@ wc -l trace-boot.txt
gem5: gem5:
.... ....
./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"' -n ./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"'
# Or: # Or:
# ./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"' -n -- --cpu-type=HPI --caches # ./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"' -- --cpu-type=HPI --caches
grep sim_insts m5out/stats.txt grep sim_insts m5out/stats.txt
.... ....

3
build
View File

@@ -114,6 +114,9 @@ BR2_ROOTFS_POST_SCRIPT_ARGS=\"$post_script_args\"
# http://lists.busybox.net/pipermail/buildroot/2017-August/201053.html # http://lists.busybox.net/pipermail/buildroot/2017-August/201053.html
sed -Ei 's/^BR2_PACKAGE_LINUX_TOOLS_GPIO/BR2_PACKAGE_LINUX_TOOLS_GPIO=n/' "${config_file}" sed -Ei 's/^BR2_PACKAGE_LINUX_TOOLS_GPIO/BR2_PACKAGE_LINUX_TOOLS_GPIO=n/' "${config_file}"
fi fi
# TODO why is this needed. Otherwise kernel .config does not change, even though Buildroot
# .config did due to -K. even if we are running linux-kernel-reconfigure!
rm -f "${out_dir}/build/linux-custom/.config"
if [ -n "$linux_kernel_custom_config_file" ]; then if [ -n "$linux_kernel_custom_config_file" ]; then
printf "BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"../${linux_kernel_custom_config_file}\"\n" >> "${config_file}" printf "BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"../${linux_kernel_custom_config_file}\"\n" >> "${config_file}"
fi fi

14
configure vendored
View File

@@ -57,13 +57,13 @@ coreutils \
" "
if "$gem5"; then if "$gem5"; then
pkgs="$pkgs \ pkgs="$pkgs \
g++-6 \ g++-6 \
gcc-6 \ gcc-6 \
gcc-aarch64-linux-gnu \ gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \ gcc-arm-linux-gnueabi \
libgoogle-perftools-dev \ libgoogle-perftools-dev \
protobuf-compiler \ protobuf-compiler \
" "
fi fi
command -v apt-get >/dev/null 2>&1 || { command -v apt-get >/dev/null 2>&1 || {
cat <<EOF cat <<EOF

View File

@@ -1,12 +1,16 @@
#/usr/bin/env bash #/usr/bin/env bash
set -eu set -eu
arch=x86_64 arch=x86_64
cross_compile=''
j='' j=''
while getopts a:j: OPT; do while getopts a:c:j: OPT; do
case "$OPT" in case "$OPT" in
a) a)
arch="$OPTARG" arch="$OPTARG"
;; ;;
c)
cross_compile="CROSS_COMPILE=$OPTARG"
;;
j) j)
j="$OPTARG" j="$OPTARG"
;; ;;
@@ -22,6 +26,9 @@ binaries_dir="${system_dir}/binaries"
disks_dir="${system_dir}/disks" disks_dir="${system_dir}/disks"
mkdir -p "$binaries_dir" "$disks_dir" mkdir -p "$binaries_dir" "$disks_dir"
cd "${top}/gem5" cd "${top}/gem5"
TARGET_CROSS=
if [ "$arch" = x86_64 ]; then if [ "$arch" = x86_64 ]; then
CC=gcc-6 CXX=g++-6 scons -j"$j" --ignore-style build/X86/gem5.opt CC=gcc-6 CXX=g++-6 scons -j"$j" --ignore-style build/X86/gem5.opt
f="${disks_dir}/linux-bigswap2.img" f="${disks_dir}/linux-bigswap2.img"
@@ -34,11 +41,12 @@ elif [ "$arch" = arm ] || [ "$arch" = aarch64 ]; then
# Compilation fails with gcc 7 on that commit. # Compilation fails with gcc 7 on that commit.
# There were some recent portability patches, so it will likely get there soon. # 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 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. # TODO use the buildroot cross compiler here, and remove the dependencies from configure.
make -C ./system/arm/simple_bootloader make -C ./system/arm/simple_bootloader/ $cross_compile
make -C ./system/arm/aarch64_bootloader/
cp ./system/arm/simple_bootloader/boot_emm.arm "$binaries_dir" 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" cp ./system/arm/aarch64_bootloader/boot_emm.arm64 "$binaries_dir"
fi fi
# TODO vs telnet? # TODO vs telnet?

View File

@@ -15,7 +15,7 @@ ARCH_MAKE = $(ARCH)
endif endif
define GEM5_BUILD_CMDS 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)' cd '$(@D)/gem5/util/m5' && $(MAKE) -f 'Makefile.$(ARCH_MAKE)' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
endef endef

4
run
View File

@@ -8,7 +8,6 @@ cpus=1
debug_vm='' debug_vm=''
kgdb=false kgdb=false
kvm=false kvm=false
nographic=false
# norandmaps: Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space. # norandmaps: Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space.
# printk.time=y: log in format: "[time ] msg" for all printk messages. # printk.time=y: log in format: "[time ] msg" for all printk messages.
# nokaslr: https://unix.stackexchange.com/questions/397939/turning-off-kaslr-to-debug-linux-kernel-using-qemu-and-gdb # nokaslr: https://unix.stackexchange.com/questions/397939/turning-off-kaslr-to-debug-linux-kernel-using-qemu-and-gdb
@@ -59,7 +58,6 @@ while getopts a:c:Dde:G:giKknt:x OPT; do
n) n)
extra_append="$extra_append console=ttyS0" extra_append="$extra_append console=ttyS0"
extra_flags_qemu="$extra_flags -nographic" extra_flags_qemu="$extra_flags -nographic"
nographic=true
;; ;;
esac esac
done done
@@ -115,7 +113,7 @@ else
extra_flags="${extra_flags_qemu} ${extra_flags}" extra_flags="${extra_flags_qemu} ${extra_flags}"
images_dir="${out_dir}/images" images_dir="${out_dir}/images"
qemu_common="\ qemu_common="\
'${debug_vm}' \ ${debug_vm} \
'${out_dir}/host/usr/bin/qemu-system-${arch}' \ '${out_dir}/host/usr/bin/qemu-system-${arch}' \
-m 128M \ -m 128M \
-monitor telnet::45454,server,nowait \ -monitor telnet::45454,server,nowait \