new file mode 100644
@@ -0,0 +1,3 @@
+mach/hurd/htl
+aarch64/htl
+mach/hurd/aarch64/htl
new file mode 100644
@@ -0,0 +1,49 @@
+/* Perform a `longjmp' on a Mach thread_state. AArch64 version.
+ Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <setjmp.h>
+#include <jmpbuf-offsets.h>
+#include <mach/thread_status.h>
+
+
+/* Set up STATE to do the equivalent of `longjmp (ENV, VAL);'. */
+
+void
+_hurd_longjmp_thread_state (void *state, jmp_buf env, int val)
+{
+ struct aarch64_thread_state *ts = state;
+
+ ts->x[19] = env[0].__jmpbuf[JB_X19];
+ ts->x[20] = env[0].__jmpbuf[JB_X20];
+ ts->x[21] = env[0].__jmpbuf[JB_X21];
+ ts->x[22] = env[0].__jmpbuf[JB_X22];
+ ts->x[23] = env[0].__jmpbuf[JB_X23];
+ ts->x[24] = env[0].__jmpbuf[JB_X24];
+ ts->x[25] = env[0].__jmpbuf[JB_X25];
+ ts->x[26] = env[0].__jmpbuf[JB_X26];
+ ts->x[27] = env[0].__jmpbuf[JB_X27];
+ ts->x[28] = env[0].__jmpbuf[JB_X28];
+ ts->x[29] = env[0].__jmpbuf[JB_X29];
+
+ /* XXX: We're ignoring all the d[] (SIMD) registers.
+ Is that fine? */
+
+ ts->pc = PTR_DEMANGLE (env[0].__jmpbuf[JB_LR]);
+ ts->sp = _jmpbuf_sp (env[0].__jmpbuf);
+ ts->x[0] = val ?: 1;
+}
new file mode 100644
@@ -0,0 +1,2 @@
+DEFAULT GLIBC_2.40
+ld=ld-aarch64.so.1
new file mode 100644
@@ -0,0 +1,52 @@
+/* Startup code for statically linked Hurd/AArch64 binaries.
+ Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+/* This is the actual entry point for statically linked aarch64-gnu executables,
+ the very first code to run in a process. */
+
+ .text
+ENTRY(_start)
+ /* Set up the initial stack frame. */
+ cfi_undefined (x30)
+ mov x29, #0
+ mov x30, #0
+
+ /* Pre-fill GOT entries for select ifunc routines that may get
+ called during _hurd_stack_setup () with baseline implementations. */
+ adrp x1, __memcpy_generic
+ add x1, x1, #:lo12:__memcpy_generic
+ adrp x0, :got:memcpy
+ str x1, [x0, :got_lo12:memcpy]
+
+ adrp x1, __strlen_generic
+ add x1, x1, #:lo12:__strlen_generic
+ adrp x0, :got:strlen
+ str x1, [x0, :got_lo12:strlen]
+
+ mov x0, sp
+ bl _hurd_stack_setup
+
+ /* Jump to the regular entry point. */
+ mov x0, #0
+ b _start1
+END(_start)
+
+#define _start _start1
+#include <sysdeps/aarch64/start.S>
new file mode 100644
@@ -0,0 +1,24 @@
+/* Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _AARCH64_VM_PARAM_H
+#define _AARCH64_VM_PARAM_H
+
+/* Arbitrary start of the brk. This is after usual binary and library mappings. */
+#define BRK_START 0x200000000000
+
+#endif /* aarch64/vm_param.h */
The following commits will add TLS, HTL, and the signal bits. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> --- sysdeps/mach/hurd/aarch64/Implies | 3 ++ sysdeps/mach/hurd/aarch64/longjmp-ts.c | 49 ++++++++++++++++++++++ sysdeps/mach/hurd/aarch64/shlib-versions | 2 + sysdeps/mach/hurd/aarch64/static-start.S | 52 ++++++++++++++++++++++++ sysdeps/mach/hurd/aarch64/vm_param.h | 24 +++++++++++ 5 files changed, 130 insertions(+) create mode 100644 sysdeps/mach/hurd/aarch64/Implies create mode 100644 sysdeps/mach/hurd/aarch64/longjmp-ts.c create mode 100644 sysdeps/mach/hurd/aarch64/shlib-versions create mode 100644 sysdeps/mach/hurd/aarch64/static-start.S create mode 100644 sysdeps/mach/hurd/aarch64/vm_param.h