base-linux: 64-bit ARM support

This patch adds support for running Genode/Linux on the AARCH64
architecture.

- The kernel-agnostic startup code (crt0) had to be extended to
  capture the initial stack pointer, which the Linux kernel uses
  to pass the process environment. This is in line with the
  existing startup code for x86_32 and x86_64.

- The link order of the host libraries linked to lx_hybrid
  programs had to be adjusted such that libgcc appears at last
  because the other libraries depend on symbols provided by
  libgcc.

- When using AARCH64 Linux as host, one can execute run scripts
  via 'make run/<script> KERNEL=linux BOARD=linux' now.

Issue #4136
This commit is contained in:
Norman Feske
2021-05-05 19:20:37 +02:00
committed by Christian Helmuth
parent 718f44ae5b
commit 2f9d430c00
21 changed files with 126 additions and 8 deletions

View File

@ -74,7 +74,7 @@ EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtbegin.o)
EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtend.o)
EXT_OBJECTS += $(shell $(CUSTOM_HOST_CC) $(CC_MARCH) -print-file-name=crtn.o)
LX_LIBS_OPT += -lgcc -lgcc_s -lsupc++ -lc -lpthread
LX_LIBS_OPT += -lgcc_s -lsupc++ -lc -lpthread -lgcc
USE_HOST_LD_SCRIPT = yes
@ -98,6 +98,11 @@ CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux.so.3
LD_SCRIPT_STATIC = ldscripts/armelf_linux_eabi.xc
endif
ifeq (arm_64,$(findstring arm_64,$(SPECS)))
CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux-aarch64.so.1
LD_SCRIPT_STATIC = /usr/lib/aarch64-linux-gnu/ldscripts/aarch64elf.xc
endif
#
# Because we use the host compiler's libgcc, omit the Genode toolchain's
# version and put all libraries here we depend on.

View File

@ -11,6 +11,7 @@ HOST_INC_DIR += /usr/include/$(shell $(CUSTOM_HOST_CC) -dumpmachine)
#
HOST_INC_DIR += /usr/include/i386-linux-gnu
HOST_INC_DIR += /usr/include/x86_64-linux-gnu
HOST_INC_DIR += /usr/include/aarch64-linux-gnu
#
# Some header files installed on GNU/Linux test for the GNU compiler. For