From patchwork Fri Nov 5 15:14:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 47118 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DCE4D3858411 for ; Fri, 5 Nov 2021 15:15:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCE4D3858411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636125306; bh=eIt+pHo/OAdKZvpeFjyasNnYmoLTQly/Nv9pbQ0fBgU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=apnh4ZR/ar8meZHo7gY7pd+Yl7g4HKmz/slb/+kqLBbyPlASywmRYmBw3PLIp75/L P5EV/rTxXl1tCj59UE0jWWo+SKRnF9HiLS9rwp7HKNdetsP56VebJ/3dC+4myL60H1 rMbKCVJ+wBhCojtzKWuDZMAtYPb5Y0ushE0Tm3Tc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id C443E3858D35 for ; Fri, 5 Nov 2021 15:14:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C443E3858D35 Received: by mail-wm1-x32a.google.com with SMTP id o29so3522707wms.2 for ; Fri, 05 Nov 2021 08:14:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=eIt+pHo/OAdKZvpeFjyasNnYmoLTQly/Nv9pbQ0fBgU=; b=3X0NBtP/eO724DNGZBXElT4dbpWENeau6N+GiYT7IJC2++BTE1NulBRvl8gvEtui+4 ojDOldANAv3RHjlXMOyEk1/+w6Ohc+ACyjbyULSd01GR5XKTTjth8R47ueDA6WODSas+ ua5ju1cMuUH0hfgbo65M8jawWX//mcinv9mFPruVXMs5zw2Mpgr5j9fhE2eGYX0PcAjX miKa+AxbfAFZxWP/NjWgLi5PeqAbF8+FeN6iCWOcrqqTMmdD+kgo/dVcmSjY7D4a9x1x +qa0uGIp+y31o2tXMKurjMAx5UH1+vTxGyJbnbrM5/io9D9mXf0Z6HHWQl8SCEWkh7Od eQJA== X-Gm-Message-State: AOAM531G7Qjj3MLSbChIwwu/RXtVaabj3m+nGAQk+x2l/Gd5TxaJ2k2j Y4DN1X48/cvXoe8wSD22v+vbfv9+K5I= X-Google-Smtp-Source: ABdhPJylCNvr3qkW9bgfOS1Oxkx37NqyzpO/YtA2faAo2jv2W3w/GXltX8eFJg3ftm07Co2KsfZxBg== X-Received: by 2002:a7b:cb10:: with SMTP id u16mr31280259wmj.65.1636125276761; Fri, 05 Nov 2021 08:14:36 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id f19sm8548200wmq.34.2021.11.05.08.14.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Nov 2021 08:14:36 -0700 (PDT) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [PATCH] Darwin, Arm64 : Initial support for the self-host driver. Date: Fri, 5 Nov 2021 15:14:29 +0000 Message-Id: <20211105151429.62376-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe , richard.sandiford@arm.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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 Signed-off-by: Iain Sandoe --- 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 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)