From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 82174385842C; Tue, 9 Apr 2024 07:24:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82174385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712647473; bh=O1xRIUOsd1pDl3MgSIxTFtX2w5kW90ubZSAwH82aKgY=; h=From:To:Subject:Date:From; b=CvzLFrOcmhgZGTy0g0QoNNA+1o8xiHmpDOU3ERUhSxFDvhjKN9w/48wYIg1jFjqev sXer6LboSMZhMvjhVpq8yReoEefT4WMyD9KxtTNobIKDL+r5aqdK3xIN5oyAvFAPUR 8OPuO31QTxrcY5FqsjbXcgvOkvY2pZB6IRJp6j/Q= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-9858] libgcc: Add basic support for aarch64-gnu (GNU/Hurd on AArch64) X-Act-Checkin: gcc X-Git-Author: Sergey Bugaev X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 9670a2326333caa8482377c00beb65723b7b4b26 X-Git-Newrev: 46c91665f4bceba19aed56f5bd6e934c548b84ff Message-Id: <20240409072433.82174385842C@sourceware.org> Date: Tue, 9 Apr 2024 07:24:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:46c91665f4bceba19aed56f5bd6e934c548b84ff commit r14-9858-g46c91665f4bceba19aed56f5bd6e934c548b84ff Author: Sergey Bugaev Date: Sat Mar 23 17:35:13 2024 +0300 libgcc: Add basic support for aarch64-gnu (GNU/Hurd on AArch64) There is currently no unwinding implementation. libgcc/ChangeLog: * config.host: Recognize aarch64*-*-gnu* hosts. * config/aarch64/gnu-unwind.h: New file. * config/aarch64/heap-trampoline.c (allocate_trampoline_page): Support GNU/Hurd. Signed-off-by: Sergey Bugaev Diff: --- libgcc/config.host | 9 +++++++++ libgcc/config/aarch64/gnu-unwind.h | 36 +++++++++++++++++++++++++++++++++ libgcc/config/aarch64/heap-trampoline.c | 4 ++-- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/libgcc/config.host b/libgcc/config.host index 59a42d3a01f..e75a7af647f 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -448,6 +448,15 @@ aarch64*-*-linux*) tmake_file="${tmake_file} t-dfprules" tmake_file="${tmake_file} ${cpu_type}/t-heap-trampoline" ;; +aarch64*-*-gnu*) + extra_parts="$extra_parts crtfastmath.o" + md_unwind_header=aarch64/gnu-unwind.h + tmake_file="${tmake_file} ${cpu_type}/t-aarch64" + tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc" + tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" + tmake_file="${tmake_file} t-dfprules" + tmake_file="${tmake_file} ${cpu_type}/t-heap-trampoline" + ;; aarch64*-*-vxworks7*) extra_parts="$extra_parts crtfastmath.o" md_unwind_header=aarch64/aarch64-unwind.h diff --git a/libgcc/config/aarch64/gnu-unwind.h b/libgcc/config/aarch64/gnu-unwind.h new file mode 100644 index 00000000000..d9e485a1849 --- /dev/null +++ b/libgcc/config/aarch64/gnu-unwind.h @@ -0,0 +1,36 @@ +/* DWARF2 EH unwinding support for GNU Hurd: aarch64. + Copyright (C) 2020-2024 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC 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 General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +/* Always include AArch64 unwinder header file. */ +#include "config/aarch64/aarch64-unwind.h" + +#ifndef inhibit_libc + +#include + +/* + * TODO: support for aarch64 needs to be implemented. + */ + +#endif /* ifndef inhibit_libc */ diff --git a/libgcc/config/aarch64/heap-trampoline.c b/libgcc/config/aarch64/heap-trampoline.c index 885df629da7..26957a3eef1 100644 --- a/libgcc/config/aarch64/heap-trampoline.c +++ b/libgcc/config/aarch64/heap-trampoline.c @@ -29,7 +29,7 @@ void *allocate_trampoline_page (void); void __gcc_nested_func_ptr_created (void *chain, void *func, void *dst); void __gcc_nested_func_ptr_deleted (void); -#if defined(__linux__) +#if defined(__linux__) || defined(__gnu_hurd__) static const unsigned char aarch64_trampoline_insns[6][4] = { {0x5f, 0x24, 0x03, 0xd5}, /* hint 34 */ {0xb1, 0x00, 0x00, 0x58}, /* ldr x17, .+20 */ @@ -82,7 +82,7 @@ allocate_trampoline_page (void) { void *page; -#if defined(__linux__) +#if defined(__linux__) || defined(__gnu_hurd__) page = mmap (0, getpagesize (), PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, 0, 0); #elif __APPLE__