Commit 91bed1a1 by Richard Earnshaw Committed by Richard Earnshaw

[aarch64] Refactor common errata work-around specs

With the addition of the AArch64 NetBSD support code we now have four
ports all using and defining the same errata work-around headers.
That's silly and long-term becomes a maintenance burden.

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.

From-SVN: r272515
parent ceb76ffc
2019-06-20 Richard Earnshaw <rearnsha@arm.com>
* 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.
2019-06-20 Marek Polacek <polacek@redhat.com> 2019-06-20 Marek Polacek <polacek@redhat.com>
* config/sh/sh.c (sh2a_function_vector_p): Use get_attribute_name. * config/sh/sh.c (sh2a_function_vector_p): Use get_attribute_name.
......
...@@ -980,7 +980,7 @@ esac ...@@ -980,7 +980,7 @@ esac
case ${target} in case ${target} in
aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h" 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" tmake_file="${tmake_file} aarch64/t-aarch64"
case $target in case $target in
aarch64-*-elf*) aarch64-*-elf*)
...@@ -1017,19 +1017,19 @@ aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) ...@@ -1017,19 +1017,19 @@ aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
;; ;;
aarch64*-*-freebsd*) aarch64*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}" 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" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
;; ;;
aarch64*-*-netbsd*) aarch64*-*-netbsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file}" 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" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt" extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;; ;;
aarch64*-*-linux*) aarch64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h" 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" tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
case $target in case $target in
......
...@@ -27,22 +27,6 @@ ...@@ -27,22 +27,6 @@
" crtend%O%s crtn%O%s " \ " crtend%O%s crtn%O%s " \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.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 #ifndef LINK_SPEC
#define LINK_SPEC "%{h*} \ #define LINK_SPEC "%{h*} \
%{static:-Bstatic} \ %{static:-Bstatic} \
...@@ -51,8 +35,7 @@ ...@@ -51,8 +35,7 @@
%{!static:%{rdynamic:-export-dynamic}} \ %{!static:%{rdynamic:-export-dynamic}} \
%{mbig-endian:-EB} %{mlittle-endian:-EL} -X \ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X \
-maarch64elf%{mabi=ilp32*:32}%{mbig-endian:b}" \ -maarch64elf%{mabi=ilp32*:32}%{mbig-endian:b}" \
CA53_ERR_835769_SPEC \ AARCH64_ERRATA_LINK_SPEC
CA53_ERR_843419_SPEC
#endif #endif
#endif /* GCC_AARCH64_ELF_RAW_H */ #endif /* GCC_AARCH64_ELF_RAW_H */
/* 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
<http://www.gnu.org/licenses/>. */
#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 */
...@@ -46,26 +46,8 @@ ...@@ -46,26 +46,8 @@
-X" SUBTARGET_EXTRA_LINK_SPEC " \ -X" SUBTARGET_EXTRA_LINK_SPEC " \
%{mbig-endian:-EB} %{mlittle-endian:-EL}" %{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 #undef LINK_SPEC
#define LINK_SPEC FBSD_TARGET_LINK_SPEC \ #define LINK_SPEC FBSD_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_SPEC
CA53_ERR_835769_SPEC \
CA53_ERR_843419_SPEC
#define GNU_USER_TARGET_MATHFILE_SPEC \ #define GNU_USER_TARGET_MATHFILE_SPEC \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
......
...@@ -46,25 +46,8 @@ ...@@ -46,25 +46,8 @@
%{mbig-endian:-EB} %{mlittle-endian:-EL} \ %{mbig-endian:-EB} %{mlittle-endian:-EL} \
-maarch64linux%{mabi=ilp32:32}%{mbig-endian:b}" -maarch64linux%{mabi=ilp32:32}%{mbig-endian:b}"
#if TARGET_FIX_ERR_A53_835769_DEFAULT
#define CA53_ERR_835769_SPEC \ #define LINK_SPEC LINUX_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_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 GNU_USER_TARGET_MATHFILE_SPEC \ #define GNU_USER_TARGET_MATHFILE_SPEC \
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
......
...@@ -39,27 +39,10 @@ ...@@ -39,27 +39,10 @@
"%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} " \ "%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} " \
"%(netbsd_link_spec)" "%(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 #undef LINK_SPEC
#define LINK_SPEC NETBSD_LINK_SPEC_ELF \ #define LINK_SPEC NETBSD_LINK_SPEC_ELF \
NETBSD_TARGET_LINK_SPEC \ NETBSD_TARGET_LINK_SPEC \
CA53_ERR_835769_SPEC \ AARCH64_ERRATA_LINK_SPEC
CA53_ERR_843419_SPEC
#undef TARGET_OS_CPP_BUILTINS #undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \ #define TARGET_OS_CPP_BUILTINS() \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment