Skip to content

Commit dec683a

Browse files
committed
devkitA64: gcc 13.1.0 RC test
1 parent 4319248 commit dec683a

4 files changed

Lines changed: 325 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 61
44
# devkitPPC release 43
5-
# devkitA64 release 21
5+
# devkitA64 release 22
66
#---------------------------------------------------------------------------------
77

88
if [ 0 -eq 1 ] ; then
Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.cc gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.cc
2+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.cc 2023-04-19 13:53:45.000000000 +0100
3+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.cc 2023-04-26 23:50:10.772394548 +0100
4+
@@ -19555,8 +19555,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-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64-elf-raw.h gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64-elf-raw.h
32+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64-elf-raw.h 2023-04-19 13:53:45.000000000 +0100
33+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64-elf-raw.h 2023-04-26 23:50:10.768394486 +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-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.h gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.h
43+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.h 2023-04-19 13:53:45.000000000 +0100
44+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.h 2023-04-26 23:52:03.318171734 +0100
45+
@@ -1154,6 +1154,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+
@@ -1185,7 +1189,7 @@
57+
58+
/* Extra specs when building a native AArch64-hosted compiler.
59+
Option rewriting rules based on host system. */
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-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.md gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.md
66+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.md 2023-04-19 13:53:45.000000000 +0100
67+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.md 2023-04-26 23:50:10.776394611 +0100
68+
@@ -7068,11 +7068,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-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.opt gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.opt
94+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64.opt 2023-04-19 13:53:45.000000000 +0100
95+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64.opt 2023-04-26 23:50:10.776394611 +0100
96+
@@ -128,6 +128,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+
@@ -266,7 +281,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-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64-opts.h gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64-opts.h
128+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/aarch64-opts.h 2023-04-19 13:53:45.000000000 +0100
129+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/aarch64-opts.h 2023-04-26 23:50:10.768394486 +0100
130+
@@ -52,6 +52,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-13.1.0-RC2-20230419.orig/gcc/config/aarch64/t-aarch64 gcc-13.1.0-RC2-20230419/gcc/config/aarch64/t-aarch64
144+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/aarch64/t-aarch64 2023-04-19 13:53:45.000000000 +0100
145+
+++ gcc-13.1.0-RC2-20230419/gcc/config/aarch64/t-aarch64 2023-04-26 23:50:10.776394611 +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-13.1.0-RC2-20230419.orig/gcc/config/devkitpro.h gcc-13.1.0-RC2-20230419/gcc/config/devkitpro.h
160+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/devkitpro.h 1970-01-01 01:00:00.000000000 +0100
161+
+++ gcc-13.1.0-RC2-20230419/gcc/config/devkitpro.h 2023-04-26 23:50:10.776394611 +0100
162+
@@ -0,0 +1,32 @@
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+
+ builtin_define ("__DEVKITPRO__"); \
192+
+ } while (0)
193+
+
194+
+
195+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/gcc/config/devkitpro.opt gcc-13.1.0-RC2-20230419/gcc/config/devkitpro.opt
196+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config/devkitpro.opt 1970-01-01 01:00:00.000000000 +0100
197+
+++ gcc-13.1.0-RC2-20230419/gcc/config/devkitpro.opt 2023-04-26 23:50:10.776394611 +0100
198+
@@ -0,0 +1,29 @@
199+
+; Options for devkitPro toolchains.
200+
+
201+
+; Copyright (C) 2011-2018 Free Software Foundation, Inc.
202+
+;
203+
+; This file is part of GCC.
204+
+;
205+
+; GCC is free software; you can redistribute it and/or modify it under
206+
+; the terms of the GNU General Public License as published by the Free
207+
+; Software Foundation; either version 3, or (at your option) any later
208+
+; version.
209+
+;
210+
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
211+
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
212+
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
213+
+; for more details.
214+
+;
215+
+; You should have received a copy of the GNU General Public License
216+
+; along with GCC; see the file COPYING3. If not see
217+
+; <http://www.gnu.org/licenses/>.
218+
+
219+
+; See the GCC internals manual (options.texi) for a description of
220+
+; this file's format.
221+
+
222+
+; Please try to keep this file in ASCII collating order.
223+
+
224+
+pthread
225+
+Driver
226+
+
227+
+; This comment is to ensure we retain the blank line above.
228+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/gcc/config.gcc gcc-13.1.0-RC2-20230419/gcc/config.gcc
229+
--- gcc-13.1.0-RC2-20230419.orig/gcc/config.gcc 2023-04-19 13:53:45.000000000 +0100
230+
+++ gcc-13.1.0-RC2-20230419/gcc/config.gcc 2023-04-26 23:50:10.768394486 +0100
231+
@@ -1132,7 +1132,14 @@
232+
tmake_file="${tmake_file} aarch64/t-aarch64"
233+
case $target in
234+
aarch64-*-elf*)
235+
+ default_use_cxa_atexit=yes
236+
use_gcc_stdint=wrap
237+
+ tm_file="${tm_file} devkitpro.h"
238+
+ tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
239+
+ extra_options="${extra_options} devkitpro.opt"
240+
+ case ${enable_threads} in
241+
+ "" | yes | posix) thread_file='posix' ;;
242+
+ esac
243+
;;
244+
aarch64-*-fuchsia*)
245+
tm_file="${tm_file} fuchsia.h"
246+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/gcc/gcc.cc gcc-13.1.0-RC2-20230419/gcc/gcc.cc
247+
--- gcc-13.1.0-RC2-20230419.orig/gcc/gcc.cc 2023-04-19 13:53:46.000000000 +0100
248+
+++ gcc-13.1.0-RC2-20230419/gcc/gcc.cc 2023-04-26 23:50:10.776394611 +0100
249+
@@ -868,6 +868,11 @@
250+
#endif
251+
#endif
252+
253+
+#ifndef LIBGLOSS_SPEC
254+
+# define LIBGLOSS_SPEC "-lsysbase"
255+
+#endif
256+
+
257+
+
258+
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
259+
#ifndef STARTFILE_SPEC
260+
#define STARTFILE_SPEC \
261+
@@ -1191,6 +1196,7 @@
262+
static const char *lib_spec = LIB_SPEC;
263+
static const char *link_gomp_spec = "";
264+
static const char *libgcc_spec = LIBGCC_SPEC;
265+
+static const char *libgloss_spec = LIBGLOSS_SPEC;
266+
static const char *endfile_spec = ENDFILE_SPEC;
267+
static const char *startfile_spec = STARTFILE_SPEC;
268+
static const char *linker_name_spec = LINKER_NAME;
269+
@@ -1701,6 +1707,7 @@
270+
INIT_STATIC_SPEC ("lib", &lib_spec),
271+
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
272+
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
273+
+ INIT_STATIC_SPEC ("libgloss", &libgloss_spec),
274+
INIT_STATIC_SPEC ("startfile", &startfile_spec),
275+
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
276+
INIT_STATIC_SPEC ("version", &compiler_version),
277+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/libgcc/crtstuff.c gcc-13.1.0-RC2-20230419/libgcc/crtstuff.c
278+
--- gcc-13.1.0-RC2-20230419.orig/libgcc/crtstuff.c 2023-04-19 13:53:49.000000000 +0100
279+
+++ gcc-13.1.0-RC2-20230419/libgcc/crtstuff.c 2023-04-26 23:50:10.776394611 +0100
280+
@@ -326,7 +326,7 @@
281+
282+
#ifdef OBJECT_FORMAT_ELF
283+
284+
-#if DEFAULT_USE_CXA_ATEXIT
285+
+#if 1 /* DEFAULT_USE_CXA_ATEXIT */
286+
/* Declare the __dso_handle variable. It should have a unique value
287+
in every shared-object; in a main program its value is zero. The
288+
object should in any case be protected. This means the instance
289+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/libgcc/gthr.h gcc-13.1.0-RC2-20230419/libgcc/gthr.h
290+
--- gcc-13.1.0-RC2-20230419.orig/libgcc/gthr.h 2023-04-19 13:53:49.000000000 +0100
291+
+++ gcc-13.1.0-RC2-20230419/libgcc/gthr.h 2023-04-26 23:50:10.776394611 +0100
292+
@@ -136,7 +136,7 @@
293+
/* The pe-coff weak support isn't fully compatible to ELF's weak.
294+
For static libraries it might would work, but as we need to deal
295+
with shared versions too, we disable it for mingw-targets. */
296+
-#ifdef __MINGW32__
297+
+#if defined(__MINGW32__) || defined(__DEVKITA64__)
298+
#undef GTHREAD_USE_WEAK
299+
#define GTHREAD_USE_WEAK 0
300+
#endif
301+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/libstdc++-v3/include/Makefile.am gcc-13.1.0-RC2-20230419/libstdc++-v3/include/Makefile.am
302+
--- gcc-13.1.0-RC2-20230419.orig/libstdc++-v3/include/Makefile.am 2023-04-19 13:53:50.000000000 +0100
303+
+++ gcc-13.1.0-RC2-20230419/libstdc++-v3/include/Makefile.am 2023-04-26 23:50:10.776394611 +0100
304+
@@ -1417,6 +1417,7 @@
305+
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
306+
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
307+
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
308+
+ -e 's/_GLIBCXX___DEVKITA64_GLIBCXX___/__DEVKITA64__/g' \
309+
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
310+
< $< > $@
311+
312+
diff -NBaur gcc-13.1.0-RC2-20230419.orig/libstdc++-v3/include/Makefile.in gcc-13.1.0-RC2-20230419/libstdc++-v3/include/Makefile.in
313+
--- gcc-13.1.0-RC2-20230419.orig/libstdc++-v3/include/Makefile.in 2023-04-19 13:53:50.000000000 +0100
314+
+++ gcc-13.1.0-RC2-20230419/libstdc++-v3/include/Makefile.in 2023-04-26 23:50:10.776394611 +0100
315+
@@ -1891,6 +1891,7 @@
316+
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
317+
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
318+
-e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
319+
+ -e 's/_GLIBCXX___DEVKITA64_GLIBCXX___/__DEVKITA64__/g' \
320+
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
321+
< $< > $@
322+

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 21" \
65+
--with-bugurl="https://github.com/devkitPro/buildscripts/issues" --with-pkgversion="devkitA64 release 22" \
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.2.0
52+
GCC_VER=13.1.0-RC2-20230419
5353
BINUTILS_VER=2.32
5454
NEWLIB_VER=4.3.0.20230120
5555
basedir='dka64'

0 commit comments

Comments
 (0)