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 02BC53858D28 for ; Fri, 5 Nov 2021 17:39:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 02BC53858D28 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 969032F; Fri, 5 Nov 2021 10:39:49 -0700 (PDT) Received: from [10.57.26.21] (unknown [10.57.26.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D35D63F7F5; Fri, 5 Nov 2021 10:39:48 -0700 (PDT) Subject: Re: [PATCH] Darwin, Arm64 : Initial support for the self-host driver. To: iain@sandoe.co.uk, gcc-patches@gcc.gnu.org Cc: Iain Sandoe , richard.sandiford@arm.com References: <20211105151429.62376-1-iain@sandoe.co.uk> From: Richard Earnshaw Message-ID: Date: Fri, 5 Nov 2021 17:39:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211105151429.62376-1-iain@sandoe.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3498.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2021 17:39:52 -0000 On 05/11/2021 15:14, Iain Sandoe via Gcc-patches wrote: > This allows people to host a c-family/fortran GCC cross-compiler on > aarch64-apple-darwin (support for Ada will follow in a separate patch). > > At present, there is no special action needed for aarch64-darwin; > this just pulls in generic Darwin code. > > Tested on aarch64-darwin20, > OK for master? > thanks, > Iain > > --- > gcc/config.host | 7 ++++- > gcc/config/aarch64/host-aarch64-darwin.c | 33 ++++++++++++++++++++++++ > gcc/config/aarch64/x-darwin | 3 +++ > 3 files changed, 42 insertions(+), 1 deletion(-) > create mode 100644 gcc/config/aarch64/host-aarch64-darwin.c > create mode 100644 gcc/config/aarch64/x-darwin > > diff --git a/gcc/config.host b/gcc/config.host > index 0a02c33cc80..37f9c719b68 100644 > --- a/gcc/config.host > +++ b/gcc/config.host > @@ -99,7 +99,8 @@ case ${host} in > esac > > case ${host} in > - aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia*) > + aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia* |\ > + aarch64*-*-darwin* | arm64*-*-darwin*) > case ${target} in I think we should avoid the term arm64. Historically we had patterns that matched arm* or arm6* for the 32-bit tools. > aarch64*-*-*) > host_extra_gcc_objs="driver-aarch64.o" > @@ -251,6 +252,10 @@ case ${host} in > host_extra_gcc_objs="${host_extra_gcc_objs} driver-mingw32.o" > host_lto_plugin_soname=liblto_plugin.dll > ;; > + aarch64*-*-darwin* | arm64*-*-darwin*) > + out_host_hook_obj="${out_host_hook_obj} host-aarch64-darwin.o" > + host_xmake_file="${host_xmake_file} aarch64/x-darwin" > + ;; > i[34567]86-*-darwin* | x86_64-*-darwin*) > out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o" > host_xmake_file="${host_xmake_file} i386/x-darwin" > diff --git a/gcc/config/aarch64/host-aarch64-darwin.c b/gcc/config/aarch64/host-aarch64-darwin.c > new file mode 100644 > index 00000000000..d70f2df3bf1 > --- /dev/null > +++ b/gcc/config/aarch64/host-aarch64-darwin.c > @@ -0,0 +1,33 @@ > +/* aarch64/arm64-darwin host-specific hook definitions. > + > +Copyright The GNU Toolchain Authors. > + > +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 > +. */ > + > +#define IN_TARGET_CODE 1 > + > +#include "config.h" > +#include "system.h" > +#include "coretypes.h" > +#include "hosthooks.h" > +#include "hosthooks-def.h" > +#include "config/host-darwin.h" > + > +/* Darwin doesn't do anything special for arm64/aarch64 hosts; this file > + exists just to include the generic config/host-darwin.h. */ > + > +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; > diff --git a/gcc/config/aarch64/x-darwin b/gcc/config/aarch64/x-darwin > new file mode 100644 > index 00000000000..6d788d5e89c > --- /dev/null > +++ b/gcc/config/aarch64/x-darwin > @@ -0,0 +1,3 @@ > +host-aarch64-darwin.o : $(srcdir)/config/aarch64/host-aarch64-darwin.c > + $(COMPILE) $< > + $(POSTCOMPILE) > Otherwise, OK. R.