Skip to content

Commit 3f96ad9

Browse files
committed
testing gcc 7.1.0
1 parent 0ae5810 commit 3f96ad9

3 files changed

Lines changed: 315 additions & 2 deletions

File tree

dkppc/patches/gcc-7.1.0.patch

Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
diff -Nbaur gcc-7.1.0/gcc/config/rs6000/rs6000.h gcc-7.1.0-ppc/gcc/config/rs6000/rs6000.h
2+
--- gcc-7.1.0/gcc/config/rs6000/rs6000.h 2017-03-22 17:47:55.000000000 +0000
3+
+++ gcc-7.1.0-ppc/gcc/config/rs6000/rs6000.h 2017-06-28 23:03:50.558004511 +0100
4+
@@ -205,6 +205,7 @@
5+
{ "asm_cpu_476", ASM_CPU_476_SPEC }, \
6+
SUBTARGET_EXTRA_SPECS
7+
8+
+#if 0
9+
/* -mcpu=native handling only makes sense with compiler running on
10+
an PowerPC chip. If changing this condition, also change
11+
the condition in driver-rs6000.c. */
12+
@@ -219,6 +220,8 @@
13+
#else
14+
#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
15+
#endif
16+
+#endif
17+
+#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
18+
19+
#ifndef CC1_CPU_SPEC
20+
#ifdef HAVE_LOCAL_CPU_DETECT
21+
diff -Nbaur gcc-7.1.0/gcc/config/rs6000/sysv4.h gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.h
22+
--- gcc-7.1.0/gcc/config/rs6000/sysv4.h 2017-02-07 11:29:06.000000000 +0000
23+
+++ gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.h 2017-06-28 23:03:50.562004807 +0100
24+
@@ -564,7 +564,12 @@
25+
26+
/* Default starting address if specified. */
27+
#define LINK_START_SPEC "\
28+
-%{mads : %(link_start_ads) ; \
29+
+%{mgcn|mogc : %(link_start_ogc) ; \
30+
+ mvgc : %(link_start_vgc) ; \
31+
+ mgcbios : %(link_start_gcb) ; \
32+
+ mrvl : %(link_start_rvl) ; \
33+
+ mwup : %(link_start_wup) ; \
34+
+ mads : %(link_start_ads) ; \
35+
myellowknife : %(link_start_yellowknife) ; \
36+
mmvme : %(link_start_mvme) ; \
37+
msim : %(link_start_sim) ; \
38+
@@ -595,7 +600,9 @@
39+
40+
/* Any specific OS flags. */
41+
#define LINK_OS_SPEC "\
42+
-%{mads : %(link_os_ads) ; \
43+
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(link_os_ogc) ; \
44+
+ mwup : %(link_os_wup) ; \
45+
+ mads : %(link_os_ads) ; \
46+
myellowknife : %(link_os_yellowknife) ; \
47+
mmvme : %(link_os_mvme) ; \
48+
msim : %(link_os_sim) ; \
49+
@@ -613,7 +620,11 @@
50+
/* Override rs6000.h definition. */
51+
#undef CPP_SPEC
52+
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
53+
-%{mads : %(cpp_os_ads) ; \
54+
+%{mgcn : %(cpp_os_gcn) ; \
55+
+ mogc|mvgc|mgcbios : %(cpp_os_ogc) ; \
56+
+ mrvl : %(cpp_os_rvl) ; \
57+
+ mwup : %(cpp_os_wup) ; \
58+
+ mads : %(cpp_os_ads) ; \
59+
myellowknife : %(cpp_os_yellowknife) ; \
60+
mmvme : %(cpp_os_mvme) ; \
61+
msim : %(cpp_os_sim) ; \
62+
@@ -627,7 +638,11 @@
63+
64+
#undef STARTFILE_SPEC
65+
#define STARTFILE_SPEC "\
66+
-%{mads : %(startfile_ads) ; \
67+
+%{mgcn : %(startfile_gcn) ; \
68+
+ mogc|mvgc|mgcbios : %(startfile_ogc) ; \
69+
+ mrvl : %(startfile_ogc) ; \
70+
+ mwup : %(startfile_wup) ; \
71+
+ mads : %(startfile_ads) ; \
72+
myellowknife : %(startfile_yellowknife) ; \
73+
mmvme : %(startfile_mvme) ; \
74+
msim : %(startfile_sim) ; \
75+
@@ -641,7 +656,9 @@
76+
77+
#undef LIB_SPEC
78+
#define LIB_SPEC "\
79+
-%{mads : %(lib_ads) ; \
80+
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(lib_ogc) ; \
81+
+ mwup : %(lib_wup) ; \
82+
+ mads : %(lib_ads) ; \
83+
myellowknife : %(lib_yellowknife) ; \
84+
mmvme : %(lib_mvme) ; \
85+
msim : %(lib_sim) ; \
86+
@@ -651,11 +668,13 @@
87+
mcall-openbsd: %(lib_openbsd) ; \
88+
: %(lib_default) }"
89+
90+
-#define LIB_DEFAULT_SPEC "-lc"
91+
+#define LIB_DEFAULT_SPEC "--start-group -lsysbase -lc --end-group"
92+
93+
#undef ENDFILE_SPEC
94+
#define ENDFILE_SPEC "\
95+
-%{mads : %(endfile_ads) ; \
96+
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(endfile_ogc) ; \
97+
+ mwup : %(endfile_wup) ; \
98+
+ mads : %(endfile_ads) ; \
99+
myellowknife : %(endfile_yellowknife) ; \
100+
mmvme : %(endfile_mvme) ; \
101+
msim : %(endfile_sim) ; \
102+
@@ -671,16 +690,33 @@
103+
104+
/* Motorola ADS support. */
105+
#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
106+
+#define LIB_OGC_SPEC "--start-group -lsysbase -lc --end-group"
107+
+#define LIB_WUP_SPEC "--start-group -lsysbase -lc --end-group"
108+
109+
#define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
110+
+#define STARTFILE_OGC_SPEC "ecrti.o%s crtbegin.o%s crtmain.o%s"
111+
+#define STARTFILE_WUP_SPEC "ecrti.o%s crtbegin.o%s crtmain.o%s"
112+
113+
#define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
114+
+#define ENDFILE_OGC_SPEC "crtend.o%s ecrtn.o%s"
115+
+#define ENDFILE_WUP_SPEC "crtend.o%s ecrtn.o%s"
116+
117+
#define LINK_START_ADS_SPEC "-T ads.ld%s"
118+
+#define LINK_START_OGC_SPEC "-T ogc.ld%s"
119+
+#define LINK_START_RVL_SPEC "-T rvl.ld%s"
120+
+#define LINK_START_WUP_SPEC "-T wup.ld%s"
121+
+#define LINK_START_VGC_SPEC "-T vgcogc.ld%s"
122+
+#define LINK_START_GCB_SPEC "-T gcbogc.ld%s"
123+
124+
#define LINK_OS_ADS_SPEC ""
125+
+#define LINK_OS_OGC_SPEC "--gc-sections"
126+
+#define LINK_OS_WUP_SPEC "--gc-sections"
127+
128+
#define CPP_OS_ADS_SPEC ""
129+
+#define CPP_OS_GCN_SPEC "-D__gamecube__ -ffunction-sections -fdata-sections"
130+
+#define CPP_OS_OGC_SPEC "-D__gamecube__ -DHW_DOL -ffunction-sections -fdata-sections"
131+
+#define CPP_OS_RVL_SPEC "-D__wii__ -DHW_RVL -ffunction-sections -fdata-sections"
132+
+#define CPP_OS_WUP_SPEC "-D__wiiu__ -DHW_WUP -ffunction-sections -fdata-sections"
133+
134+
/* Motorola Yellowknife support. */
135+
#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
136+
@@ -871,6 +907,8 @@
137+
#undef SUBTARGET_EXTRA_SPECS
138+
#define SUBTARGET_EXTRA_SPECS \
139+
{ "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \
140+
+ { "lib_ogc", LIB_OGC_SPEC }, \
141+
+ { "lib_wup", LIB_WUP_SPEC }, \
142+
{ "lib_ads", LIB_ADS_SPEC }, \
143+
{ "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
144+
{ "lib_mvme", LIB_MVME_SPEC }, \
145+
@@ -880,6 +918,8 @@
146+
{ "lib_netbsd", LIB_NETBSD_SPEC }, \
147+
{ "lib_openbsd", LIB_OPENBSD_SPEC }, \
148+
{ "lib_default", LIB_DEFAULT_SPEC }, \
149+
+ { "startfile_ogc", STARTFILE_OGC_SPEC }, \
150+
+ { "startfile_wup", STARTFILE_WUP_SPEC }, \
151+
{ "startfile_ads", STARTFILE_ADS_SPEC }, \
152+
{ "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \
153+
{ "startfile_mvme", STARTFILE_MVME_SPEC }, \
154+
@@ -889,6 +929,8 @@
155+
{ "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
156+
{ "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \
157+
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
158+
+ { "endfile_ogc", ENDFILE_OGC_SPEC }, \
159+
+ { "endfile_wup", ENDFILE_WUP_SPEC }, \
160+
{ "endfile_ads", ENDFILE_ADS_SPEC }, \
161+
{ "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \
162+
{ "endfile_mvme", ENDFILE_MVME_SPEC }, \
163+
@@ -900,7 +942,12 @@
164+
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
165+
{ "link_shlib", LINK_SHLIB_SPEC }, \
166+
{ "link_start", LINK_START_SPEC }, \
167+
+ { "link_start_vgc", LINK_START_VGC_SPEC }, \
168+
+ { "link_start_gcb", LINK_START_GCB_SPEC }, \
169+
+ { "link_start_rvl", LINK_START_RVL_SPEC }, \
170+
+ { "link_start_wup", LINK_START_WUP_SPEC }, \
171+
{ "link_start_ads", LINK_START_ADS_SPEC }, \
172+
+ { "link_start_ogc", LINK_START_OGC_SPEC }, \
173+
{ "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \
174+
{ "link_start_mvme", LINK_START_MVME_SPEC }, \
175+
{ "link_start_sim", LINK_START_SIM_SPEC }, \
176+
@@ -910,6 +957,8 @@
177+
{ "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \
178+
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
179+
{ "link_os", LINK_OS_SPEC }, \
180+
+ { "link_os_ogc", LINK_OS_OGC_SPEC }, \
181+
+ { "link_os_wup", LINK_OS_WUP_SPEC }, \
182+
{ "link_os_ads", LINK_OS_ADS_SPEC }, \
183+
{ "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \
184+
{ "link_os_mvme", LINK_OS_MVME_SPEC }, \
185+
@@ -921,6 +970,10 @@
186+
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
187+
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
188+
{ "link_secure_plt", LINK_SECURE_PLT_SPEC }, \
189+
+ { "cpp_os_gcn", CPP_OS_GCN_SPEC }, \
190+
+ { "cpp_os_ogc", CPP_OS_OGC_SPEC }, \
191+
+ { "cpp_os_rvl", CPP_OS_RVL_SPEC }, \
192+
+ { "cpp_os_wup", CPP_OS_WUP_SPEC }, \
193+
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
194+
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
195+
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
196+
diff -Nbaur gcc-7.1.0/gcc/config/rs6000/sysv4.opt gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.opt
197+
--- gcc-7.1.0/gcc/config/rs6000/sysv4.opt 2017-01-01 12:07:43.000000000 +0000
198+
+++ gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.opt 2017-06-28 23:03:50.562004807 +0100
199+
@@ -120,6 +120,30 @@
200+
Target RejectNegative
201+
Link with libads.a, libc.a and crt0.o.
202+
203+
+mgcn
204+
+Target RejectNegative
205+
+Link with libsysbase.a and libc.a, use ogc linker script
206+
+
207+
+mogc
208+
+Target RejectNegative
209+
+Link with libsysbase.a and libc.a, use ogc linker script
210+
+
211+
+mgcbios
212+
+Target RejectNegative
213+
+Link with libsysbase.a and libc.a, use gcbogc linker script
214+
+
215+
+mvgc
216+
+Target RejectNegative
217+
+Link with libsysbase.a and libc.a, use gcbogc linker script
218+
+
219+
+mrvl
220+
+Target RejectNegative
221+
+Link with libsysbase.a and libc.a, use rvl linker script
222+
+
223+
+mwup
224+
+Target RejectNegative
225+
+Link with libsysbase.a and libc.a, use wup linker script
226+
+
227+
myellowknife
228+
Target RejectNegative
229+
Link with libyk.a, libc.a and crt0.o.
230+
diff -Nbaur gcc-7.1.0/gcc/config.gcc gcc-7.1.0-ppc/gcc/config.gcc
231+
--- gcc-7.1.0/gcc/config.gcc 2017-03-24 13:59:51.000000000 +0000
232+
+++ gcc-7.1.0-ppc/gcc/config.gcc 2017-06-28 23:03:50.566005054 +0100
233+
@@ -2404,7 +2404,7 @@
234+
use_gcc_stdint=wrap
235+
;;
236+
powerpc-*-eabi*)
237+
- tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
238+
+ tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/750cl.h"
239+
extra_options="${extra_options} rs6000/sysv4.opt"
240+
tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
241+
use_gcc_stdint=wrap
242+
diff -Nbaur gcc-7.1.0/gcc/Makefile.in gcc-7.1.0-ppc/gcc/Makefile.in
243+
--- gcc-7.1.0/gcc/Makefile.in 2017-04-18 19:10:27.000000000 +0100
244+
+++ gcc-7.1.0-ppc/gcc/Makefile.in 2017-06-28 23:03:50.570005229 +0100
245+
@@ -1087,8 +1087,8 @@
246+
# things like the go/%.o rule work properly; but we use $(*F) for the
247+
# file part, as we just want the file part of the stem, not the entire
248+
# file name.
249+
-COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo
250+
-POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po
251+
+COMPILE = $(COMPILE.base)
252+
+POSTCOMPILE =
253+
else
254+
COMPILE = source='$<' object='$@' libtool=no \
255+
DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) $(COMPILE.base)
256+
diff -Nbaur gcc-7.1.0/libcpp/Makefile.in gcc-7.1.0-ppc/libcpp/Makefile.in
257+
--- gcc-7.1.0/libcpp/Makefile.in 2017-05-02 13:43:57.000000000 +0100
258+
+++ gcc-7.1.0-ppc/libcpp/Makefile.in 2017-06-28 23:03:50.570005229 +0100
259+
@@ -208,8 +208,7 @@
260+
# Note that we put the dependencies into a .Tpo file, then move them
261+
# into place if the compile succeeds. We need this because gcc does
262+
# not atomically write the dependency output file.
263+
-COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo
264+
-POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
265+
+COMPILE = $(COMPILE.base) -o $@
266+
else
267+
COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
268+
$(depcomp) $(COMPILE.base)
269+
diff -Nbaur gcc-7.1.0/libgcc/config/rs6000/crtrestvr.S gcc-7.1.0-ppc/libgcc/config/rs6000/crtrestvr.S
270+
--- gcc-7.1.0/libgcc/config/rs6000/crtrestvr.S 2017-03-10 19:29:48.000000000 +0000
271+
+++ gcc-7.1.0-ppc/libgcc/config/rs6000/crtrestvr.S 2017-06-28 23:03:50.570005229 +0100
272+
@@ -24,7 +24,7 @@
273+
274+
/* On PowerPC64 Linux, these functions are provided by the linker. */
275+
#ifndef __powerpc64__
276+
-
277+
+#if 0
278+
#undef __ALTIVEC__
279+
#define __ALTIVEC__ 1
280+
#include "ppc-asm.h"
281+
@@ -86,3 +86,4 @@
282+
CFI_ENDPROC
283+
284+
#endif
285+
+#endif
286+
diff -Nbaur gcc-7.1.0/libgcc/config/rs6000/crtsavevr.S gcc-7.1.0-ppc/libgcc/config/rs6000/crtsavevr.S
287+
--- gcc-7.1.0/libgcc/config/rs6000/crtsavevr.S 2017-03-10 19:29:48.000000000 +0000
288+
+++ gcc-7.1.0-ppc/libgcc/config/rs6000/crtsavevr.S 2017-06-28 23:03:50.574005432 +0100
289+
@@ -24,7 +24,7 @@
290+
291+
/* On PowerPC64 Linux, these functions are provided by the linker. */
292+
#ifndef __powerpc64__
293+
-
294+
+#if 0
295+
#undef __ALTIVEC__
296+
#define __ALTIVEC__ 1
297+
#include "ppc-asm.h"
298+
@@ -86,3 +86,4 @@
299+
CFI_ENDPROC
300+
301+
#endif
302+
+#endif
303+
diff -Nbaur gcc-7.1.0/libgcc/crtstuff.c gcc-7.1.0-ppc/libgcc/crtstuff.c
304+
--- gcc-7.1.0/libgcc/crtstuff.c 2017-01-01 12:07:43.000000000 +0000
305+
+++ gcc-7.1.0-ppc/libgcc/crtstuff.c 2017-06-28 23:03:50.574005432 +0100
306+
@@ -47,6 +47,7 @@
307+
308+
/* Target machine header files require this define. */
309+
#define IN_LIBGCC2
310+
+#define USED_FOR_TARGET
311+
312+
/* FIXME: Including auto-host is incorrect, but until we have
313+
identified the set of defines that need to go into auto-target.h,

dkppc/scripts/build-gcc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ then
9595
--with-headers=../../newlib-$NEWLIB_VER/newlib/libc/include \
9696
--prefix=$prefix\
9797
--with-system-zlib\
98-
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPPC release 30" \
98+
--with-bugurl="http://wiki.devkitpro.org/index.php/Bug_Reports" --with-pkgversion="devkitPPC release 30 alpha" \
9999
$CROSS_PARAMS \
100100
|| { echo "Error configuring gcc stage 1"; exit 1; }
101101
touch configured-gcc

select_toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ case "$VERSION" in
4040
toolchain=DEVKITARM
4141
;;
4242
"2" )
43-
GCC_VER=6.3.0
43+
GCC_VER=7.1.0
4444
BINUTILS_VER=2.28
4545
MN_BINUTILS_VER=2.17
4646
NEWLIB_VER=2.5.0

0 commit comments

Comments
 (0)