Skip to content

Commit ca6cded

Browse files
committed
devkitA64: update gcc to 12.2.0
1 parent 149a235 commit ca6cded

4 files changed

Lines changed: 337 additions & 3 deletions

File tree

build-devkit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#---------------------------------------------------------------------------------
33
# devkitARM release 59
44
# devkitPPC release 41
5-
# devkitA64 release 19
5+
# devkitA64 release 20
66
#---------------------------------------------------------------------------------
77

88
if [ 0 -eq 1 ] ; then

dka64/patches/gcc-12.2.0.patch

Lines changed: 334 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,334 @@
1+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.cc gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.cc
2+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.cc 2022-04-29 14:58:22.000000000 +0100
3+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.cc 2022-05-02 21:50:30.090088643 +0100
4+
@@ -19417,8 +19417,24 @@
5+
|| !register_operand (target, Pmode))
6+
target = gen_reg_rtx (Pmode);
7+
8+
- /* Can return in any reg. */
9+
- emit_insn (gen_aarch64_load_tp_hard (target));
10+
+ if (TARGET_HARD_TP)
11+
+ {
12+
+ /* Can return in any reg. */
13+
+ emit_insn (gen_aarch64_load_tp_hard (target));
14+
+ }
15+
+ else
16+
+ {
17+
+ /* Always returned in r0. Immediately copy the result into a pseudo,
18+
+ otherwise other uses of r0 (e.g. setting up function arguments) may
19+
+ clobber the value. */
20+
+
21+
+ rtx tmp;
22+
+
23+
+ emit_insn (gen_aarch64_load_tp_soft ());
24+
+
25+
+ tmp = gen_rtx_REG (DImode, R0_REGNUM);
26+
+ emit_move_insn (target, tmp);
27+
+ }
28+
return target;
29+
}
30+
31+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64-elf-raw.h gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64-elf-raw.h
32+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64-elf-raw.h 2022-04-29 14:58:22.000000000 +0100
33+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64-elf-raw.h 2022-05-02 21:50:30.086094234 +0100
34+
@@ -22,6 +22,7 @@
35+
#ifndef GCC_AARCH64_ELF_RAW_H
36+
#define GCC_AARCH64_ELF_RAW_H
37+
38+
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
39+
#define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
40+
#define ENDFILE_SPEC \
41+
" crtend%O%s crtn%O%s " \
42+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.h gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.h
43+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.h 2022-04-29 14:58:22.000000000 +0100
44+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.h 2022-05-02 21:50:30.090088643 +0100
45+
@@ -1245,6 +1245,10 @@
46+
/* Check TLS Descriptors mechanism is selected. */
47+
#define TARGET_TLS_DESC (aarch64_tls_dialect == TLS_DESCRIPTORS)
48+
49+
+/* Check selected thread pointer access sequence to use. */
50+
+#define TARGET_HARD_TP (target_thread_pointer == TP_HARD)
51+
+#define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT)
52+
+
53+
extern enum aarch64_code_model aarch64_cmodel;
54+
55+
/* When using the tiny addressing model conditional and unconditional branches
56+
@@ -1290,7 +1294,7 @@
57+
#define MCPU_TO_MARCH_SPEC_FUNCTIONS \
58+
{ "rewrite_mcpu", aarch64_rewrite_mcpu },
59+
60+
-#if defined(__aarch64__)
61+
+#if 0 // defined(__aarch64__)
62+
extern const char *host_detect_local_cpu (int argc, const char **argv);
63+
#define HAVE_LOCAL_CPU_DETECT
64+
# define EXTRA_SPEC_FUNCTIONS \
65+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.md gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.md
66+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.md 2022-04-29 14:58:22.000000000 +0100
67+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.md 2022-05-02 21:50:30.090088643 +0100
68+
@@ -6899,11 +6899,22 @@
69+
(define_insn "aarch64_load_tp_hard"
70+
[(set (match_operand:DI 0 "register_operand" "=r")
71+
(unspec:DI [(const_int 0)] UNSPEC_TLS))]
72+
- ""
73+
- "mrs\\t%0, tpidr_el0"
74+
+ "TARGET_HARD_TP"
75+
+ "mrs\\t%0, tpidr_el0\\t// aarch64_load_tp_hard"
76+
[(set_attr "type" "mrs")]
77+
)
78+
79+
+(define_insn "aarch64_load_tp_soft"
80+
+ [(set (reg:DI 0) (unspec:DI [(const_int 0)] UNSPEC_TLS))
81+
+ (clobber (reg:DI IP0_REGNUM))
82+
+ (clobber (reg:DI IP1_REGNUM))
83+
+ (clobber (reg:DI LR_REGNUM))
84+
+ (clobber (reg:CC CC_REGNUM))]
85+
+ "TARGET_SOFT_TP"
86+
+ "bl\\t__aarch64_read_tp\\t// aarch64_load_tp_soft"
87+
+ [(set_attr "type" "branch")]
88+
+)
89+
+
90+
;; The TLS ABI specifically requires that the compiler does not schedule
91+
;; instructions in the TLS stubs, in order to enable linker relaxation.
92+
;; Therefore we treat the stubs as an atomic sequence.
93+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.opt gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.opt
94+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64.opt 2022-04-29 14:58:22.000000000 +0100
95+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64.opt 2022-05-02 21:50:30.090088643 +0100
96+
@@ -122,6 +122,21 @@
97+
EnumValue
98+
Enum(aarch64_tls_size) String(48) Value(48)
99+
100+
+mtp=
101+
+Target RejectNegative Joined Enum(aarch64_tp_type) Var(target_thread_pointer) Init(TP_HARD)
102+
+Specify how to access the thread pointer.
103+
+
104+
+Enum
105+
+Name(aarch64_tp_type) Type(enum aarch64_tp_type)
106+
+Valid arguments to -mtp=:
107+
+
108+
+EnumValue
109+
+Enum(aarch64_tp_type) String(hard) Value(TP_HARD)
110+
+
111+
+EnumValue
112+
+Enum(aarch64_tp_type) String(soft) Value(TP_SOFT)
113+
+
114+
+
115+
march=
116+
Target RejectNegative Negative(march=) ToLower Joined Var(aarch64_arch_string)
117+
Use features of architecture ARCH.
118+
@@ -260,7 +275,7 @@
119+
long aarch64_stack_protector_guard_offset = 0
120+
121+
moutline-atomics
122+
-Target Var(aarch64_flag_outline_atomics) Init(2) Save
123+
+Target Var(aarch64_flag_outline_atomics) Save
124+
Generate local calls to out-of-line atomic operations.
125+
126+
-param=aarch64-sve-compare-costs=
127+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64-opts.h gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64-opts.h
128+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/aarch64-opts.h 2022-04-29 14:58:22.000000000 +0100
129+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/aarch64-opts.h 2022-05-02 21:50:30.086094234 +0100
130+
@@ -48,6 +48,12 @@
131+
TLS_DESCRIPTORS
132+
};
133+
134+
+/* Which thread pointer access sequence to use. */
135+
+enum aarch64_tp_type {
136+
+ TP_HARD,
137+
+ TP_SOFT
138+
+};
139+
+
140+
/* The code model defines the address generation strategy.
141+
Most have a PIC and non-PIC variant. */
142+
enum aarch64_code_model {
143+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/aarch64/t-aarch64 gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/t-aarch64
144+
--- gcc-12.1.0-RC-20220429/gcc/config/aarch64/t-aarch64 2022-04-29 14:58:22.000000000 +0100
145+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/aarch64/t-aarch64 2022-05-02 21:50:30.090088643 +0100
146+
@@ -177,8 +177,10 @@
147+
$(srcdir)/config/aarch64/aarch64-cc-fusion.cc
148+
149+
comma=,
150+
-MULTILIB_OPTIONS = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG))))
151+
-MULTILIB_DIRNAMES = $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
152+
+MULTILIB_OPTIONS = mcmodel=large fPIC
153+
+MULTILIB_DIRNAMES = large pic
154+
+MULTILIB_REQUIRED = mcmodel=large fPIC
155+
+MULTILIB_MATCHES = fPIC=fpic fPIC=fpie fPIC=fPIE
156+
157+
insn-conditions.md: s-check-sve-md
158+
s-check-sve-md: $(srcdir)/config/aarch64/check-sve-md.awk \
159+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/devkitpro.h gcc-12.1.0-RC-20220429-dka64/gcc/config/devkitpro.h
160+
--- gcc-12.1.0-RC-20220429/gcc/config/devkitpro.h 1970-01-01 01:00:00.000000000 +0100
161+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/devkitpro.h 2022-05-02 22:04:49.962851033 +0100
162+
@@ -0,0 +1,29 @@
163+
+/* Definitions for devkitPro toolchains.
164+
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
165+
+
166+
+ This file is part of GCC.
167+
+
168+
+ GCC is free software; you can redistribute it and/or modify it
169+
+ under the terms of the GNU General Public License as published
170+
+ by the Free Software Foundation; either version 3, or (at your
171+
+ option) any later version.
172+
+
173+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
174+
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
175+
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
176+
+ License for more details.
177+
+
178+
+ Under Section 7 of GPL version 3, you are granted additional
179+
+ permissions described in the GCC Runtime Library Exception, version
180+
+ 3.1, as published by the Free Software Foundation.
181+
+
182+
+ You should have received a copy of the GNU General Public License and
183+
+ a copy of the GCC Runtime Library Exception along with this program;
184+
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
185+
+ <http://www.gnu.org/licenses/>. */
186+
+
187+
+#undef TARGET_OS_CPP_BUILTINS
188+
+#define TARGET_OS_CPP_BUILTINS() \
189+
+ do { \
190+
+ builtin_define ("__DEVKITA64__"); \
191+
+ } while (0)
192+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/devkitpro.opt gcc-12.1.0-RC-20220429-dka64/gcc/config/devkitpro.opt
193+
--- gcc-12.1.0-RC-20220429/gcc/config/devkitpro.opt 1970-01-01 01:00:00.000000000 +0100
194+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/devkitpro.opt 2022-05-02 21:50:30.090088643 +0100
195+
@@ -0,0 +1,29 @@
196+
+; Options for devkitPro toolchains.
197+
+
198+
+; Copyright (C) 2011-2018 Free Software Foundation, Inc.
199+
+;
200+
+; This file is part of GCC.
201+
+;
202+
+; GCC is free software; you can redistribute it and/or modify it under
203+
+; the terms of the GNU General Public License as published by the Free
204+
+; Software Foundation; either version 3, or (at your option) any later
205+
+; version.
206+
+;
207+
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
208+
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
209+
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
210+
+; for more details.
211+
+;
212+
+; You should have received a copy of the GNU General Public License
213+
+; along with GCC; see the file COPYING3. If not see
214+
+; <http://www.gnu.org/licenses/>.
215+
+
216+
+; See the GCC internals manual (options.texi) for a description of
217+
+; this file's format.
218+
+
219+
+; Please try to keep this file in ASCII collating order.
220+
+
221+
+pthread
222+
+Driver
223+
+
224+
+; This comment is to ensure we retain the blank line above.
225+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config/i386/host-mingw32.cc gcc-12.1.0-RC-20220429-dka64/gcc/config/i386/host-mingw32.cc
226+
--- gcc-12.1.0-RC-20220429/gcc/config/i386/host-mingw32.cc 2022-04-29 14:58:22.000000000 +0100
227+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config/i386/host-mingw32.cc 2022-05-02 21:50:30.090088643 +0100
228+
@@ -45,7 +45,11 @@
229+
static inline void w32_error(const char*, const char*, int, const char*);
230+
231+
/* FIXME: Is this big enough? */
232+
+#if __MINGW64__
233+
+static const size_t pch_VA_max_size = UINT64_C(64 * 1024 * 1024 * 1024);
234+
+#else
235+
static const size_t pch_VA_max_size = 128 * 1024 * 1024;
236+
+#endif
237+
238+
/* Granularity for reserving address space. */
239+
static size_t va_granularity = 0x10000;
240+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/config.gcc gcc-12.1.0-RC-20220429-dka64/gcc/config.gcc
241+
--- gcc-12.1.0-RC-20220429/gcc/config.gcc 2022-04-29 14:58:22.000000000 +0100
242+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/config.gcc 2022-05-02 21:50:30.086094234 +0100
243+
@@ -1093,7 +1093,14 @@
244+
tmake_file="${tmake_file} aarch64/t-aarch64"
245+
case $target in
246+
aarch64-*-elf*)
247+
+ default_use_cxa_atexit=yes
248+
use_gcc_stdint=wrap
249+
+ tm_file="${tm_file} devkitpro.h"
250+
+ tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
251+
+ extra_options="${extra_options} devkitpro.opt"
252+
+ case ${enable_threads} in
253+
+ "" | yes | posix) thread_file='posix' ;;
254+
+ esac
255+
;;
256+
aarch64-*-fuchsia*)
257+
tm_file="${tm_file} fuchsia.h"
258+
diff -NBaur gcc-12.1.0-RC-20220429/gcc/gcc.cc gcc-12.1.0-RC-20220429-dka64/gcc/gcc.cc
259+
--- gcc-12.1.0-RC-20220429/gcc/gcc.cc 2022-04-29 14:58:23.000000000 +0100
260+
+++ gcc-12.1.0-RC-20220429-dka64/gcc/gcc.cc 2022-05-02 21:50:30.090088643 +0100
261+
@@ -860,6 +860,11 @@
262+
#endif
263+
#endif
264+
265+
+#ifndef LIBGLOSS_SPEC
266+
+# define LIBGLOSS_SPEC "-lsysbase"
267+
+#endif
268+
+
269+
+
270+
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
271+
#ifndef STARTFILE_SPEC
272+
#define STARTFILE_SPEC \
273+
@@ -1204,6 +1209,7 @@
274+
static const char *lib_spec = LIB_SPEC;
275+
static const char *link_gomp_spec = "";
276+
static const char *libgcc_spec = LIBGCC_SPEC;
277+
+static const char *libgloss_spec = LIBGLOSS_SPEC;
278+
static const char *endfile_spec = ENDFILE_SPEC;
279+
static const char *startfile_spec = STARTFILE_SPEC;
280+
static const char *linker_name_spec = LINKER_NAME;
281+
@@ -1709,6 +1715,7 @@
282+
INIT_STATIC_SPEC ("lib", &lib_spec),
283+
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
284+
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
285+
+ INIT_STATIC_SPEC ("libgloss", &libgloss_spec),
286+
INIT_STATIC_SPEC ("startfile", &startfile_spec),
287+
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
288+
INIT_STATIC_SPEC ("version", &compiler_version),
289+
diff -NBaur gcc-12.1.0-RC-20220429/libgcc/crtstuff.c gcc-12.1.0-RC-20220429-dka64/libgcc/crtstuff.c
290+
--- gcc-12.1.0-RC-20220429/libgcc/crtstuff.c 2022-04-29 14:58:25.000000000 +0100
291+
+++ gcc-12.1.0-RC-20220429-dka64/libgcc/crtstuff.c 2022-05-02 21:50:30.094083051 +0100
292+
@@ -325,7 +325,7 @@
293+
294+
#ifdef OBJECT_FORMAT_ELF
295+
296+
-#if DEFAULT_USE_CXA_ATEXIT
297+
+#if 1 /* DEFAULT_USE_CXA_ATEXIT */
298+
/* Declare the __dso_handle variable. It should have a unique value
299+
in every shared-object; in a main program its value is zero. The
300+
object should in any case be protected. This means the instance
301+
diff -NBaur gcc-12.1.0-RC-20220429/libgcc/gthr.h gcc-12.1.0-RC-20220429-dka64/libgcc/gthr.h
302+
--- gcc-12.1.0-RC-20220429/libgcc/gthr.h 2022-04-29 14:58:25.000000000 +0100
303+
+++ gcc-12.1.0-RC-20220429-dka64/libgcc/gthr.h 2022-05-02 21:50:30.094083051 +0100
304+
@@ -136,7 +136,7 @@
305+
/* The pe-coff weak support isn't fully compatible to ELF's weak.
306+
For static libraries it might would work, but as we need to deal
307+
with shared versions too, we disable it for mingw-targets. */
308+
-#ifdef __MINGW32__
309+
+#if defined(__MINGW32__) || defined(__DEVKITA64__)
310+
#undef GTHREAD_USE_WEAK
311+
#define GTHREAD_USE_WEAK 0
312+
#endif
313+
diff -NBaur gcc-12.1.0-RC-20220429/libstdc++-v3/include/Makefile.am gcc-12.1.0-RC-20220429-dka64/libstdc++-v3/include/Makefile.am
314+
--- gcc-12.1.0-RC-20220429/libstdc++-v3/include/Makefile.am 2022-04-29 14:58:26.000000000 +0100
315+
+++ gcc-12.1.0-RC-20220429-dka64/libstdc++-v3/include/Makefile.am 2022-05-02 21:50:30.094083051 +0100
316+
@@ -1366,6 +1366,7 @@
317+
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
318+
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
319+
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
320+
+ -e 's/_GLIBCXX___DEVKITA64_GLIBCXX___/__DEVKITA64__/g' \
321+
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
322+
< $< > $@
323+
324+
diff -NBaur gcc-12.1.0-RC-20220429/libstdc++-v3/include/Makefile.in gcc-12.1.0-RC-20220429-dka64/libstdc++-v3/include/Makefile.in
325+
--- gcc-12.1.0-RC-20220429/libstdc++-v3/include/Makefile.in 2022-04-29 14:58:26.000000000 +0100
326+
+++ gcc-12.1.0-RC-20220429-dka64/libstdc++-v3/include/Makefile.in 2022-05-02 21:50:30.094083051 +0100
327+
@@ -1857,6 +1857,7 @@
328+
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
329+
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
330+
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
331+
+ -e 's/_GLIBCXX___DEVKITA64_GLIBCXX___/__DEVKITA64__/g' \
332+
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
333+
< $< > $@
334+

dka64/scripts/build-gcc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ then
6262
--enable-lto \
6363
--disable-tm-clone-registry \
6464
--disable-__cxa_atexit \
65-
--with-bugurl="https://github.com/devkitPro/buildscripts/issues" --with-pkgversion="devkitA64 release 19" \
65+
--with-bugurl="https://github.com/devkitPro/buildscripts/issues" --with-pkgversion="devkitA64 release 20" \
6666
$CROSS_PARAMS \
6767
$CROSS_GCC_PARAMS \
6868
$EXTRA_GCC_PARAMS \

select_toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ case "$VERSION" in
4949
toolchain=DEVKITPPC
5050
;;
5151
"3" )
52-
GCC_VER=12.1.0
52+
GCC_VER=12.2.0
5353
BINUTILS_VER=2.32
5454
NEWLIB_VER=4.2.0.20211231
5555
basedir='dka64'

0 commit comments

Comments
 (0)