From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id DB77B3858D28 for ; Tue, 2 Apr 2024 17:26:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB77B3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DB77B3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712078771; cv=none; b=MjXDnzSGFycbbRxMAXWibKN/VOXa92GsNvoKm63m+QfMRESHfSYwcwlhxV9PF9tSHyO1DL6xBedGULsvoldWxehUl0H6IrE5FB/wv9ky8cYXe8VSNkVsXPJpdW3YKxOoBVvitMXO945ScxEBuDdpg3q8oi2FOzPu7iuWWK/10uQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712078771; c=relaxed/simple; bh=E/1dqHgBIm/1bt6uXrgy+w+8mf+JCSZrxyENPSUcQVQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OYD51ycdYByzulhil7gCJGhiHIzqVs2HuhUChKZg//uf5EpyI+ou6w8I0VXlgv08mMOpXxsvp/PynMzIWqjb7s4WVH6FApIdVEFkPe+nFUVoKMimuXqwjLJWGps2aNXBqBIFL5z4DWjPcoPtqBZDTu4kmrHKUgPvJAMLz7icXM0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6FD01007; Tue, 2 Apr 2024 10:26:39 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3FC83F766; Tue, 2 Apr 2024 10:26:07 -0700 (PDT) From: Richard Sandiford To: Sergey Bugaev Mail-Followup-To: Sergey Bugaev ,gcc-patches@gcc.gnu.org, bug-hurd@gnu.org, Thomas Schwinge , richard.sandiford@arm.com Cc: gcc-patches@gcc.gnu.org, bug-hurd@gnu.org, Thomas Schwinge Subject: Re: [PATCH v2 2/3] aarch64: Add support for aarch64-gnu (GNU/Hurd on AArch64) References: <20240323143513.120786-1-bugaevc@gmail.com> <20240323143513.120786-2-bugaevc@gmail.com> Date: Tue, 02 Apr 2024 18:26:06 +0100 In-Reply-To: <20240323143513.120786-2-bugaevc@gmail.com> (Sergey Bugaev's message of "Sat, 23 Mar 2024 17:35:12 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-20.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Sergey Bugaev writes: > Coupled with a corresponding binutils patch, this produces a toolchain that can > sucessfully build working binaries targeting aarch64-gnu. > > gcc/Changelog: > > * config.gcc: Recognize aarch64*-*-gnu* targets. > * config/aarch64/aarch64-gnu.h: New file. > > Signed-off-by: Sergey Bugaev > --- > gcc/config.gcc | 6 +++ > gcc/config/aarch64/aarch64-gnu.h | 68 ++++++++++++++++++++++++++++++++ > 2 files changed, 74 insertions(+) > create mode 100644 gcc/config/aarch64/aarch64-gnu.h I don't know if you're waiting on me, but just in case: this and patch 3 still LGTM if Thomas is OK with them. Thanks, Richard > diff --git a/gcc/config.gcc b/gcc/config.gcc > index 87a5c92b6..9d935164c 100644 > --- a/gcc/config.gcc > +++ b/gcc/config.gcc > @@ -1264,6 +1264,12 @@ aarch64*-*-linux*) > done > TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'` > ;; > +aarch64*-*-gnu*) > + tm_file="${tm_file} elfos.h gnu-user.h gnu.h glibc-stdint.h" > + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-gnu.h" > + tmake_file="${tmake_file} aarch64/t-aarch64" > + tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" > + ;; > aarch64*-wrs-vxworks*) > tm_file="${tm_file} elfos.h aarch64/aarch64-elf.h" > tm_file="${tm_file} vx-common.h vxworks.h aarch64/aarch64-vxworks.h" > diff --git a/gcc/config/aarch64/aarch64-gnu.h b/gcc/config/aarch64/aarch64-gnu.h > new file mode 100644 > index 000000000..ee5494034 > --- /dev/null > +++ b/gcc/config/aarch64/aarch64-gnu.h > @@ -0,0 +1,68 @@ > +/* Definitions for AArch64 running GNU/Hurd. > + Copyright (C) 2009-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. > + > + You should have received a copy of the GNU General Public License > + along with GCC; see the file COPYING3. If not see > + . */ > + > +#ifndef GCC_AARCH64_GNU_H > +#define GCC_AARCH64_GNU_H > + > +#define GNU_USER_DYNAMIC_LINKER "/lib/ld-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" > + > +#define CPP_SPEC "%{pthread:-D_REENTRANT}" > + > +#define GNU_TARGET_LINK_SPEC "%{h*} \ > + %{static:-Bstatic} \ > + %{shared:-shared} \ > + %{symbolic:-Bsymbolic} \ > + %{!static:%{!static-pie: \ > + %{rdynamic:-export-dynamic} \ > + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}} \ > + %{static-pie:-Bstatic -pie --no-dynamic-linker -z text} \ > + -X \ > + %{mbig-endian:-EB} %{mlittle-endian:-EL} \ > + -maarch64gnu%{mabi=ilp32:32}%{mbig-endian:b}" > + > + > +#define LINK_SPEC GNU_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC > + > +#define GNU_USER_TARGET_MATHFILE_SPEC \ > + "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}}" > + > +#undef ENDFILE_SPEC > +#define ENDFILE_SPEC \ > + GNU_USER_TARGET_MATHFILE_SPEC " " \ > + GNU_USER_TARGET_ENDFILE_SPEC > + > +#define TARGET_OS_CPP_BUILTINS() \ > + do \ > + { \ > + GNU_USER_TARGET_OS_CPP_BUILTINS(); \ > + } \ > + while (0) > + > +#define TARGET_ASM_FILE_END aarch64_file_end_indicate_exec_stack > + > +/* Uninitialized common symbols in non-PIE executables, even with > + strong definitions in dependent shared libraries, will resolve > + to COPY relocated symbol in the executable. See PR65780. */ > +#undef TARGET_BINDS_LOCAL_P > +#define TARGET_BINDS_LOCAL_P default_binds_local_p_2 > + > +/* Define this to be nonzero if static stack checking is supported. */ > +#define STACK_CHECK_STATIC_BUILTIN 1 > + > +#endif /* GCC_AARCH64_GNU_H */