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

@@ -0,0 +1,3 @@
include $(BASE_DIR)/lib/mk/startup.inc
vpath crt0.s $(call select_from_repositories,src/lib/startup/spec/arm_64)

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2019 Genode Labs GmbH
* Copyright (C) 2019-2021 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
@@ -24,6 +24,12 @@
.global _start_initial_stack
_start_initial_stack:
/* save initial SP value, used to pass the environment on base-linux */
adrp x4, :got:__initial_sp
ldr x4, [x4, #:got_lo12:__initial_sp]
mov x1, sp
str x1, [x4]
/*
* Install initial temporary environment that is replaced later by the
* environment that init_main_thread creates.
@@ -53,6 +59,10 @@
*********************************/
.bss
/* initial value of the SP register */
.global __initial_sp
__initial_sp:
.space 8
/* stack of the temporary initial environment */
.p2align 8