From patchwork Thu Jun 20 17:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 167345 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2346025ilk; Thu, 20 Jun 2019 10:29:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2S3BkpngUtr8XrNGm7tPbeM/sKhESRsSfpKgvikQTZM88VNERmNti6qUn91rxFovP0M7p X-Received: by 2002:a17:90b:8d2:: with SMTP id ds18mr811503pjb.132.1561051761904; Thu, 20 Jun 2019 10:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561051761; cv=none; d=google.com; s=arc-20160816; b=WGaLd8afdyaQ3PDXEKJQTUQeCDjJEjWP0QATjrI+Ecv38686KcLtPARHRWHD52wYHS M016tJhnDZyCsnA/w8n+Nqspop12ut7t2QXtb1Z92vWY6thlECjqJNwWQV6GRBX5KH9b GSeET7u9ZQooRUI9GKwzlRPx3+2tF1Zk/LUGbYESWnepk+KEWveJweeLb45im12K5Hde /MQJIU69+mt42fZoNhni51SKg18wFif0i/slVWsl2P2HQgihCbIjrIqbBQcPrHU9AQKL a+QSQiY3kFq+MMGqWQZhWKHyDfEf33T+tLKf67hrzbbyR1iwNAZn3mi+CEN/2beTylzs kDuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:openpgp:subject:from:to :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=EKjoBnfcoYxL/dLoKWZsEEvecz4uiRGJwz0o9C/9dOY=; b=uOyXgo5E/eZkhFOj3hikcqHU60FN1SJBfyqhQ+aPBNbk7lY6kYvAxQTKF/KDoR5OWU EQnz0es5j6RThJD+n/JKZempC4YER8y03BSCHXX0oPt9bZYFVzbgE6cDp8ddzE+xEhiV tLnvxDWFPmYW8xycjM7IfYERTE75hNX8FDOyT4BqjCEdPKGRMmd3uDU+FgpJmD8VDM3j 72G6mPzQjaI4SXAaepbO8gETA5BuvRdK16sG1emG6AWTihSQiGILe/rEVM7Lm986ExPQ bVmoO8oT5ClmhOippI8TDSa9f4cN4Za9fKs9iHxFtmml+b6Gz9CY/e4Iyu1YIiu/x+zr QAew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="RC/FfgrA"; spf=pass (google.com: domain of gcc-patches-return-503389-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-503389-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b5si271915pls.83.2019.06.20.10.29.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2019 10:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-503389-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="RC/FfgrA"; spf=pass (google.com: domain of gcc-patches-return-503389-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-503389-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=bCnJHzEE19P5ywQJ/W9bvXt3Ie2XzmlOseIkkzSoW0R4hJchvN gmBpawmh+R1U2BBLDSrS6gmnIaNY5O0nhpjJn9Qad3NGCT8zvgUw40Q+bzCOaOvo GYnNjuWfdV0BlBfsHVWcA3DAzEzk9po+HL6rjIuDdpR9P5Xpovif0HYS0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=eGz4Gyw4W3A4MzbdHTyTVhJkZ1A=; b=RC/FfgrAxxX8nzwVs0EN VG7O/H/2MNIrVdklYNs8MUP/9gribafx8/pwif02+sGupm3l5TTonBGmXrZddLhW 5/lTUDDr1TgMQFXHQwPl81npQsZqzyymwv76Yb99pwn0u7vevuP5BmY9wskcrlTg fOmzghB7E3lURU8DgKTrsvE= Received: (qmail 30158 invoked by alias); 20 Jun 2019 17:29:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30150 invoked by uid 89); 20 Jun 2019 17:29:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy=long-term, longterm, Cross, UD:aarch64-netbsd.h X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Jun 2019 17:29:08 +0000 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 15AA3360; Thu, 20 Jun 2019 10:29:06 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.226]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 975FD3F246; Thu, 20 Jun 2019 10:29:05 -0700 (PDT) To: gcc-patches From: "Richard Earnshaw (lists)" Subject: [aarch64] Refactor common errata work-around specs Openpgp: preference=signencrypt Message-ID: Date: Thu, 20 Jun 2019 18:29:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 I noticed while adding the AArch64 NetBSD support code that we now had four ports all using and defining the same errata work-around headers. That's silly and long-term becomes a maintenance burden. So this patch factors all that code into a single header to eliminate all the duplication. * config/aarch64/aarch64-errata.h: New file. * config/aarch64/aarch64-elf-raw.h (CA53_ERR_835769_SPEC): Delete. (CA53_ERR_843419_SPEC): Delete. (LINK_SPEC): Use AARCH64_ERRATA_LINK_SPEC instead of above. * config/aarch64/aarch64-linux.h: Likewise. * config/aarch64/aarch64-netbsd.h: Likewise. * config/aarch64/aarch64-freebsd.h: Likewise. Full bootstrap on aarch64 linux. Cross built the other targets and manually verified that the specs file has the right contents. Committed to trunk. R. diff --git a/gcc/config.gcc b/gcc/config.gcc index fda048dc12b..33c5ddebc96 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -980,7 +980,7 @@ esac case ${target} in aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h" - tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h" tmake_file="${tmake_file} aarch64/t-aarch64" case $target in aarch64-*-elf*) @@ -1017,19 +1017,19 @@ aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) ;; aarch64*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}" - tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-freebsd.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-freebsd.h" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd" tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" ;; aarch64*-*-netbsd*) tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file}" - tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-netbsd.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-netbsd.h" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" ;; aarch64*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h" - tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux" tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" case $target in diff --git a/gcc/config/aarch64/aarch64-elf-raw.h b/gcc/config/aarch64/aarch64-elf-raw.h index bbebd0ef029..8fe7b378360 100644 --- a/gcc/config/aarch64/aarch64-elf-raw.h +++ b/gcc/config/aarch64/aarch64-elf-raw.h @@ -27,22 +27,6 @@ " crtend%O%s crtn%O%s " \ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" -#if TARGET_FIX_ERR_A53_835769_DEFAULT -#define CA53_ERR_835769_SPEC \ - " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" -#else -#define CA53_ERR_835769_SPEC \ - " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" -#endif - -#if TARGET_FIX_ERR_A53_843419_DEFAULT -#define CA53_ERR_843419_SPEC \ - " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" -#else -#define CA53_ERR_843419_SPEC \ - " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" -#endif - #ifndef LINK_SPEC #define LINK_SPEC "%{h*} \ %{static:-Bstatic} \ @@ -51,8 +35,7 @@ %{!static:%{rdynamic:-export-dynamic}} \ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X \ -maarch64elf%{mabi=ilp32*:32}%{mbig-endian:b}" \ - CA53_ERR_835769_SPEC \ - CA53_ERR_843419_SPEC + AARCH64_ERRATA_LINK_SPEC #endif #endif /* GCC_AARCH64_ELF_RAW_H */ diff --git a/gcc/config/aarch64/aarch64-errata.h b/gcc/config/aarch64/aarch64-errata.h new file mode 100644 index 00000000000..8f062536e8b --- /dev/null +++ b/gcc/config/aarch64/aarch64-errata.h @@ -0,0 +1,44 @@ +/* Machine description for AArch64 architecture. + Copyright (C) 2009-2019 Free Software Foundation, Inc. + Contributed by ARM Ltd. + + 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_ERRATA_H +#define GCC_AARCH64_ERRATA_H + +#if TARGET_FIX_ERR_A53_835769_DEFAULT +#define CA53_ERR_835769_SPEC \ + " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" +#else +#define CA53_ERR_835769_SPEC \ + " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" +#endif + +#if TARGET_FIX_ERR_A53_843419_DEFAULT +#define CA53_ERR_843419_SPEC \ + " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" +#else +#define CA53_ERR_843419_SPEC \ + " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" +#endif + +#define AARCH64_ERRATA_LINK_SPEC \ + CA53_ERR_835769_SPEC \ + CA53_ERR_843419_SPEC + +#endif /* GCC_AARCH64_ERRATA_H */ diff --git a/gcc/config/aarch64/aarch64-freebsd.h b/gcc/config/aarch64/aarch64-freebsd.h index 899e6f95e34..7a3e89b1b0e 100644 --- a/gcc/config/aarch64/aarch64-freebsd.h +++ b/gcc/config/aarch64/aarch64-freebsd.h @@ -46,26 +46,8 @@ -X" SUBTARGET_EXTRA_LINK_SPEC " \ %{mbig-endian:-EB} %{mlittle-endian:-EL}" -#if TARGET_FIX_ERR_A53_835769_DEFAULT -#define CA53_ERR_835769_SPEC \ - " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" -#else -#define CA53_ERR_835769_SPEC \ - " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" -#endif - -#ifdef TARGET_FIX_ERR_A53_843419_DEFAULT -#define CA53_ERR_843419_SPEC \ - " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" -#else -#define CA53_ERR_843419_SPEC \ - " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" -#endif - #undef LINK_SPEC -#define LINK_SPEC FBSD_TARGET_LINK_SPEC \ - CA53_ERR_835769_SPEC \ - CA53_ERR_843419_SPEC +#define LINK_SPEC FBSD_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC #define GNU_USER_TARGET_MATHFILE_SPEC \ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h index 5e8b34ded03..6ff2163b633 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -46,25 +46,8 @@ %{mbig-endian:-EB} %{mlittle-endian:-EL} \ -maarch64linux%{mabi=ilp32:32}%{mbig-endian:b}" -#if TARGET_FIX_ERR_A53_835769_DEFAULT -#define CA53_ERR_835769_SPEC \ - " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" -#else -#define CA53_ERR_835769_SPEC \ - " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" -#endif - -#if TARGET_FIX_ERR_A53_843419_DEFAULT -#define CA53_ERR_843419_SPEC \ - " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" -#else -#define CA53_ERR_843419_SPEC \ - " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" -#endif - -#define LINK_SPEC LINUX_TARGET_LINK_SPEC \ - CA53_ERR_835769_SPEC \ - CA53_ERR_843419_SPEC + +#define LINK_SPEC LINUX_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC #define GNU_USER_TARGET_MATHFILE_SPEC \ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" diff --git a/gcc/config/aarch64/aarch64-netbsd.h b/gcc/config/aarch64/aarch64-netbsd.h index 2686a1b7ae7..e6c9264bd4a 100644 --- a/gcc/config/aarch64/aarch64-netbsd.h +++ b/gcc/config/aarch64/aarch64-netbsd.h @@ -39,27 +39,10 @@ "%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} " \ "%(netbsd_link_spec)" -#if TARGET_FIX_ERR_A53_835769_DEFAULT -#define CA53_ERR_835769_SPEC \ - " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" -#else -#define CA53_ERR_835769_SPEC \ - " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" -#endif - -#ifdef TARGET_FIX_ERR_A53_843419_DEFAULT -#define CA53_ERR_843419_SPEC \ - " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" -#else -#define CA53_ERR_843419_SPEC \ - " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" -#endif - #undef LINK_SPEC #define LINK_SPEC NETBSD_LINK_SPEC_ELF \ NETBSD_TARGET_LINK_SPEC \ - CA53_ERR_835769_SPEC \ - CA53_ERR_843419_SPEC + AARCH64_ERRATA_LINK_SPEC #undef TARGET_OS_CPP_BUILTINS #define TARGET_OS_CPP_BUILTINS() \