aboutsummaryrefslogtreecommitdiffstats
path: root/lang/gcc5/files/patch-aarch64-support
blob: 7272a1382b30f524d583f6f3ed043ad1de9f3940 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
--- UTC
Index: configure
===================================================================
--- configure   (revision 240731)
+++ configure   (working copy)
@@ -3455,6 +3455,9 @@
   *-*-vxworks*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  aarch64*-*-freebsd*)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
   alpha*-*-*vms*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
Index: configure.ac
===================================================================
--- configure.ac    (revision 240731)
+++ configure.ac    (working copy)
@@ -802,6 +802,9 @@
   *-*-vxworks*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  aarch64*-*-freebsd*)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
   alpha*-*-*vms*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
Index: gcc/config/aarch64/aarch64-freebsd.h
===================================================================
--- gcc/config/aarch64/aarch64-freebsd.h    (nonexistent)
+++ gcc/config/aarch64/aarch64-freebsd.h    (working copy)
@@ -0,0 +1,94 @@
+/* Definitions for AArch64 running FreeBSD
+   Copyright (C) 2016 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
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_AARCH64_FREEBSD_H
+#define GCC_AARCH64_FREEBSD_H
+
+#undef  SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC
+
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_LINKER_EMULATION  "aarch64fbsdb"
+#else
+#define TARGET_LINKER_EMULATION  "aarch64fbsd"
+#endif
+
+#undef  SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
+
+#undef  FBSD_TARGET_LINK_SPEC
+#define FBSD_TARGET_LINK_SPEC "                                 \
+    %{p:%nconsider using `-pg' instead of `-p' with gprof (1) } \
+    %{v:-V}                                                     \
+    %{assert*} %{R*} %{rpath*} %{defsym*}                       \
+    %{shared:-Bshareable %{h*} %{soname*}}                      \
+    %{symbolic:-Bsymbolic}                                      \
+    %{static:-Bstatic}                                          \
+    %{!static:                                                  \
+      %{rdynamic:-export-dynamic}                               \
+      %{!shared:-dynamic-linker " FBSD_DYNAMIC_LINKER " }}      \
+    -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 GNU_USER_TARGET_MATHFILE_SPEC \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+    GNU_USER_TARGET_MATHFILE_SPEC " " \
+    FBSD_ENDFILE_SPEC
+
+#undef  TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()              \
+  do                                          \
+  {                                           \
+      FBSD_TARGET_OS_CPP_BUILTINS ();         \
+  }                                           \
+  while (false)
+
+#define TARGET_ASM_FILE_END 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
+
+#endif  /* GCC_AARCH64_FREEBSD_H */
Index: gcc/config/aarch64/t-aarch64-freebsd
===================================================================
--- gcc/config/aarch64/t-aarch64-freebsd    (nonexistent)
+++ gcc/config/aarch64/t-aarch64-freebsd    (working copy)
@@ -0,0 +1,21 @@
+# Machine description for AArch64 architecture.
+#  Copyright (C) 2016 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
+#  <http://www.gnu.org/licenses/>.
+
+LIB1ASMSRC   = aarch64/lib1funcs.asm
+LIB1ASMFUNCS = _aarch64_sync_cache_range
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc  (revision 240731)
+++ gcc/config.gcc  (working copy)
@@ -914,6 +914,11 @@
    done
    TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
    ;;
+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"
+   tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
+   ;;
 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"
Index: libgcc/config.host
===================================================================
--- libgcc/config.host  (revision 240731)
+++ libgcc/config.host  (working copy)
@@ -328,6 +328,11 @@
    tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
    tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
    ;;
+aarch64*-*-freebsd*)
+   extra_parts="$extra_parts crtfastmath.o"
+   tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
+   tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
+   ;;
 aarch64*-*-linux*)
    extra_parts="$extra_parts crtfastmath.o"
    md_unwind_header=aarch64/linux-unwind.h