add psp gcc 11.2.0 patch
[rofl0r-mmix-cross.git] / patches / gcc-4.7.4-musl.diff
blobde333f9093fcb9e3dfefc4e271bceac808b9b389
1 # HG changeset patch
2 # Parent 724438e38408b0d9d8a1926fe245a69f88503577
3 Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
5 diff -r 724438e38408 libstdc++-v3/configure.host
6 --- a/libstdc++-v3/configure.host Fri Dec 25 15:05:43 2015 -0500
7 +++ b/libstdc++-v3/configure.host Fri Dec 25 15:06:25 2015 -0500
8 @@ -243,6 +243,13 @@
9 os_include_dir="os/bsd/freebsd"
11 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
12 + # check for musl by target
13 + case "${host_os}" in
14 + *-musl*)
15 + os_include_dir="os/generic"
16 + ;;
17 + *)
19 if [ "$uclibc" = "yes" ]; then
20 os_include_dir="os/uclibc"
21 elif [ "$bionic" = "yes" ]; then
22 @@ -251,6 +258,9 @@
23 os_include_dir="os/gnu-linux"
27 + esac
28 + ;;
29 hpux*)
30 os_include_dir="os/hpux"
32 # HG changeset patch
33 # Parent 8f703fbc0e5b68c66b5cecac1cbd30b828d3ff9c
34 Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
36 diff -r 8f703fbc0e5b gcc/config.gcc
37 --- a/gcc/config.gcc Fri Dec 25 15:06:25 2015 -0500
38 +++ b/gcc/config.gcc Fri Dec 25 15:06:28 2015 -0500
39 @@ -522,7 +522,7 @@
40 esac
42 # Common C libraries.
43 -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
44 +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
46 # Common parts for widely ported systems.
47 case ${target} in
48 @@ -625,6 +625,9 @@
49 *-*-*uclibc*)
50 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
52 + *-*-*musl*)
53 + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
54 + ;;
56 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
58 diff -r 8f703fbc0e5b gcc/config/linux.h
59 --- a/gcc/config/linux.h Fri Dec 25 15:06:25 2015 -0500
60 +++ b/gcc/config/linux.h Fri Dec 25 15:06:28 2015 -0500
61 @@ -33,10 +33,12 @@
62 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
63 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
64 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
65 +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
66 #else
67 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
68 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
69 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
70 +#define OPTION_MUSL (linux_libc == LIBC_MUSL)
71 #endif
73 #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
74 @@ -54,18 +56,21 @@
75 uClibc or Bionic is the default C library and whether
76 -muclibc or -mglibc or -mbionic has been passed to change the default. */
78 -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
79 - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
80 +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
81 + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
83 #if DEFAULT_LIBC == LIBC_GLIBC
84 -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
85 - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
86 +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
87 + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
88 #elif DEFAULT_LIBC == LIBC_UCLIBC
89 -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
90 - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
91 +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
92 + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
93 #elif DEFAULT_LIBC == LIBC_BIONIC
94 -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
95 - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
96 +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
97 + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
98 +#elif DEFAULT_LIBC == LIBC_MUSL
99 +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
100 + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
101 #else
102 #error "Unsupported DEFAULT_LIBC"
103 #endif /* DEFAULT_LIBC */
104 @@ -85,21 +90,21 @@
106 #define GNU_USER_DYNAMIC_LINKER \
107 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
108 - BIONIC_DYNAMIC_LINKER)
109 + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
110 #define GNU_USER_DYNAMIC_LINKER32 \
111 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
112 - BIONIC_DYNAMIC_LINKER32)
113 + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
114 #define GNU_USER_DYNAMIC_LINKER64 \
115 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
116 - BIONIC_DYNAMIC_LINKER64)
117 + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
118 #define GNU_USER_DYNAMIC_LINKERX32 \
119 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
120 - BIONIC_DYNAMIC_LINKERX32)
121 + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
123 /* Determine whether the entire c99 runtime
124 is present in the runtime library. */
125 #undef TARGET_C99_FUNCTIONS
126 -#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
127 +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL)
129 /* Whether we have sincos that follows the GNU extension. */
130 #undef TARGET_HAS_SINCOS
131 @@ -108,3 +113,74 @@
132 /* Whether we have Bionic libc runtime */
133 #undef TARGET_HAS_BIONIC
134 #define TARGET_HAS_BIONIC (OPTION_BIONIC)
136 +/* musl avoids problematic includes by rearranging the include directories.
137 + * Unfortunately, this is mostly duplicated from cppdefault.c */
138 +#if DEFAULT_LIBC == LIBC_MUSL
139 +#define INCLUDE_DEFAULTS_MUSL_GPP \
140 + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
141 + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
142 + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
143 + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
144 + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
145 + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
147 +#ifdef LOCAL_INCLUDE_DIR
148 +#define INCLUDE_DEFAULTS_MUSL_LOCAL \
149 + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
150 + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
151 +#else
152 +#define INCLUDE_DEFAULTS_MUSL_LOCAL
153 +#endif
155 +#ifdef PREFIX_INCLUDE_DIR
156 +#define INCLUDE_DEFAULTS_MUSL_PREFIX \
157 + { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
158 +#else
159 +#define INCLUDE_DEFAULTS_MUSL_PREFIX
160 +#endif
162 +#ifdef CROSS_INCLUDE_DIR
163 +#define INCLUDE_DEFAULTS_MUSL_CROSS \
164 + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
165 +#else
166 +#define INCLUDE_DEFAULTS_MUSL_CROSS
167 +#endif
169 +#ifdef TOOL_INCLUDE_DIR
170 +#define INCLUDE_DEFAULTS_MUSL_TOOL \
171 + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
172 +#else
173 +#define INCLUDE_DEFAULTS_MUSL_TOOL
174 +#endif
176 +#ifdef NATIVE_SYSTEM_HEADER_DIR
177 +#define INCLUDE_DEFAULTS_MUSL_NATIVE \
178 + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
179 + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
180 +#else
181 +#define INCLUDE_DEFAULTS_MUSL_NATIVE
182 +#endif
184 +#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
185 +# undef INCLUDE_DEFAULTS_MUSL_LOCAL
186 +# define INCLUDE_DEFAULTS_MUSL_LOCAL
187 +# undef INCLUDE_DEFAULTS_MUSL_NATIVE
188 +# define INCLUDE_DEFAULTS_MUSL_NATIVE
189 +#else
190 +# undef INCLUDE_DEFAULTS_MUSL_CROSS
191 +# define INCLUDE_DEFAULTS_MUSL_CROSS
192 +#endif
194 +#undef INCLUDE_DEFAULTS
195 +#define INCLUDE_DEFAULTS \
196 + { \
197 + INCLUDE_DEFAULTS_MUSL_GPP \
198 + INCLUDE_DEFAULTS_MUSL_PREFIX \
199 + INCLUDE_DEFAULTS_MUSL_CROSS \
200 + INCLUDE_DEFAULTS_MUSL_TOOL \
201 + INCLUDE_DEFAULTS_MUSL_NATIVE \
202 + { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
203 + { 0, 0, 0, 0, 0, 0 } \
205 +#endif
206 diff -r 8f703fbc0e5b gcc/config/linux.opt
207 --- a/gcc/config/linux.opt Fri Dec 25 15:06:25 2015 -0500
208 +++ b/gcc/config/linux.opt Fri Dec 25 15:06:28 2015 -0500
209 @@ -30,3 +30,7 @@
210 muclibc
211 Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
212 Use uClibc C library
214 +mmusl
215 +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
216 +Use musl C library
217 diff -r 8f703fbc0e5b gcc/ginclude/stddef.h
218 --- a/gcc/ginclude/stddef.h Fri Dec 25 15:06:25 2015 -0500
219 +++ b/gcc/ginclude/stddef.h Fri Dec 25 15:06:28 2015 -0500
220 @@ -184,6 +184,7 @@
221 #ifndef _GCC_SIZE_T
222 #ifndef _SIZET_
223 #ifndef __size_t
224 +#ifndef __DEFINED_size_t /* musl */
225 #define __size_t__ /* BeOS */
226 #define __SIZE_T__ /* Cray Unicos/Mk */
227 #define _SIZE_T
228 @@ -200,6 +201,7 @@
229 #define ___int_size_t_h
230 #define _GCC_SIZE_T
231 #define _SIZET_
232 +#define __DEFINED_size_t /* musl */
233 #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
234 || defined(__FreeBSD_kernel__)
235 /* __size_t is a typedef on FreeBSD 5, must not trash it. */
236 @@ -215,6 +217,7 @@
237 typedef long ssize_t;
238 #endif /* __BEOS__ */
239 #endif /* !(defined (__GNUG__) && defined (size_t)) */
240 +#endif /* __DEFINED_size_t */
241 #endif /* __size_t */
242 #endif /* _SIZET_ */
243 #endif /* _GCC_SIZE_T */
244 # HG changeset patch
245 # Parent 1698fdade8f23b7b21d806029ef94a176be7333c
246 A fix for libgomp to correctly request a POSIX version for time support.
248 diff -r 1698fdade8f2 libgomp/config/posix/time.c
249 --- a/libgomp/config/posix/time.c Fri Dec 25 15:06:28 2015 -0500
250 +++ b/libgomp/config/posix/time.c Fri Dec 25 15:06:32 2015 -0500
251 @@ -28,6 +28,8 @@
252 The following implementation uses the most simple POSIX routines.
253 If present, POSIX 4 clocks should be used instead. */
255 +#define _POSIX_C_SOURCE 199309L /* for clocks */
257 #include "libgomp.h"
258 #include <unistd.h>
259 #if TIME_WITH_SYS_TIME
260 diff -r 0bc42a39d3cc libgcc/unwind-dw2-fde-dip.c
261 --- a/libgcc/unwind-dw2-fde-dip.c Fri Dec 25 15:06:32 2015 -0500
262 +++ b/libgcc/unwind-dw2-fde-dip.c Fri Dec 25 15:06:35 2015 -0500
263 @@ -47,28 +47,13 @@
264 #include "unwind-compat.h"
265 #include "gthr.h"
267 -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
268 - && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
269 - || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
270 +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
271 # define USE_PT_GNU_EH_FRAME
272 -#endif
274 -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
275 - && defined(__FreeBSD__) && __FreeBSD__ >= 7
276 -# define ElfW __ElfN
277 -# define USE_PT_GNU_EH_FRAME
278 -#endif
280 -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
281 - && defined(__OpenBSD__)
282 -# define ElfW(type) Elf_##type
283 -# define USE_PT_GNU_EH_FRAME
284 -#endif
286 -#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
287 - && defined(TARGET_DL_ITERATE_PHDR) \
288 - && defined(__sun__) && defined(__svr4__)
289 -# define USE_PT_GNU_EH_FRAME
290 +# ifdef __OpenBSD__
291 +# define ElfW(type) Elf_##typ
292 +# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
293 +# define ElfW __ElfN
294 +# endif
295 #endif
297 #if defined(USE_PT_GNU_EH_FRAME)
298 diff -r 52cde1ccaef2 gcc/configure
299 --- a/gcc/configure Fri Dec 25 15:06:35 2015 -0500
300 +++ b/gcc/configure Fri Dec 25 15:06:38 2015 -0500
301 @@ -26791,6 +26791,9 @@
302 else
303 gcc_cv_libc_provides_ssp=no
304 case "$target" in
305 + *-*-musl*)
306 + # All versions of musl provide stack protector
307 + gcc_cv_libc_provides_ssp=yes;;
308 *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
309 # glibc 2.4 and later provides __stack_chk_fail and
310 # either __stack_chk_guard, or TLS access to stack guard canary.
311 @@ -26824,6 +26827,7 @@
312 # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
313 # simply assert that glibc does provide this, which is true for all
314 # realistically usable GNU/Hurd configurations.
315 + # All supported versions of musl provide it as well
316 gcc_cv_libc_provides_ssp=yes;;
317 *-*-darwin* | *-*-freebsd*)
318 ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
319 @@ -26906,6 +26910,9 @@
320 gcc_cv_target_dl_iterate_phdr=no
323 + *-linux-musl*)
324 + gcc_cv_target_dl_iterate_phdr=yes
325 + ;;
326 esac
328 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
329 diff -r 52cde1ccaef2 gcc/configure.ac
330 --- a/gcc/configure.ac Fri Dec 25 15:06:35 2015 -0500
331 +++ b/gcc/configure.ac Fri Dec 25 15:06:38 2015 -0500
332 @@ -4669,6 +4669,9 @@
333 gcc_cv_libc_provides_ssp,
334 [gcc_cv_libc_provides_ssp=no
335 case "$target" in
336 + *-*-musl*)
337 + # All versions of musl provide stack protector
338 + gcc_cv_libc_provides_ssp=yes;;
339 *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
340 [# glibc 2.4 and later provides __stack_chk_fail and
341 # either __stack_chk_guard, or TLS access to stack guard canary.
342 @@ -4702,6 +4705,7 @@
343 # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
344 # simply assert that glibc does provide this, which is true for all
345 # realistically usable GNU/Hurd configurations.
346 + # All supported versions of musl provide it as well
347 gcc_cv_libc_provides_ssp=yes;;
348 *-*-darwin* | *-*-freebsd*)
349 AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
350 @@ -4767,6 +4771,9 @@
351 gcc_cv_target_dl_iterate_phdr=no
354 + *-linux-musl*)
355 + gcc_cv_target_dl_iterate_phdr=yes
356 + ;;
357 esac
358 GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
359 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
360 # HG changeset patch
361 # Parent 74792c2a09da063a3db254b45fd86140f16ef1ff
362 Get rid of ever-broken fixincludes on musl.
364 diff -r 74792c2a09da fixincludes/mkfixinc.sh
365 --- a/fixincludes/mkfixinc.sh Fri Dec 25 15:06:38 2015 -0500
366 +++ b/fixincludes/mkfixinc.sh Fri Dec 25 15:06:41 2015 -0500
367 @@ -20,7 +20,8 @@
368 powerpc-*-eabi* | \
369 powerpc-*-rtems* | \
370 powerpcle-*-eabisim* | \
371 - powerpcle-*-eabi* )
372 + powerpcle-*-eabi* | \
373 + *-musl* )
374 # IF there is no include fixing,
375 # THEN create a no-op fixer and exit
376 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
377 # HG changeset patch
378 # Parent 301217b079b23bdd427120d47fda630be845dd8d
379 New config.sub for GCC versions too early for the update.
381 diff -r 301217b079b2 config.sub
382 --- a/config.sub Fri Dec 25 15:06:41 2015 -0500
383 +++ b/config.sub Fri Dec 25 15:06:44 2015 -0500
384 @@ -4,7 +4,7 @@
385 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
386 # 2011 Free Software Foundation, Inc.
388 -timestamp='2011-10-29'
389 +timestamp='2011-03-23'
391 # This file is (in principle) common to ALL GNU software.
392 # The presence of a machine in this file suggests that SOME GNU software
393 @@ -125,6 +125,7 @@
394 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
395 case $maybe_os in
396 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
397 + linux-musl* | \
398 linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
399 knetbsd*-gnu* | netbsd*-gnu* | \
400 kopensolaris*-gnu* | \
401 @@ -251,17 +252,13 @@
402 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
403 | am33_2.0 \
404 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
405 - | be32 | be64 \
406 | bfin \
407 | c4x | clipper \
408 | d10v | d30v | dlx | dsp16xx \
409 - | epiphany \
410 | fido | fr30 | frv \
411 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
412 - | hexagon \
413 | i370 | i860 | i960 | ia64 \
414 | ip2k | iq2000 \
415 - | le32 | le64 \
416 | lm32 \
417 | m32c | m32r | m32rle | m68000 | m68k | m88k \
418 | maxq | mb | microblaze | mcore | mep | metag \
419 @@ -295,7 +292,7 @@
420 | pdp10 | pdp11 | pj | pjl \
421 | powerpc | powerpc64 | powerpc64le | powerpcle \
422 | pyramid \
423 - | rl78 | rx \
424 + | rx \
425 | score \
426 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
427 | sh64 | sh64le \
428 @@ -304,7 +301,7 @@
429 | spu \
430 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
431 | ubicom32 \
432 - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
433 + | v850 | v850e \
434 | we32k \
435 | x86 | xc16x | xstormy16 | xtensa \
436 | z8k | z80)
437 @@ -361,7 +358,6 @@
438 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
439 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
440 | avr-* | avr32-* \
441 - | be32-* | be64-* \
442 | bfin-* | bs2000-* \
443 | c[123]* | c30-* | [cjt]90-* | c4x-* \
444 | clipper-* | craynv-* | cydra-* \
445 @@ -370,10 +366,8 @@
446 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
447 | h8300-* | h8500-* \
448 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
449 - | hexagon-* \
450 | i*86-* | i860-* | i960-* | ia64-* \
451 | ip2k-* | iq2000-* \
452 - | le32-* | le64-* \
453 | lm32-* \
454 | m32c-* | m32r-* | m32rle-* \
455 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
456 @@ -407,7 +401,7 @@
457 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
458 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
459 | pyramid-* \
460 - | rl78-* | romp-* | rs6000-* | rx-* \
461 + | romp-* | rs6000-* | rx-* \
462 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
463 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
464 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
465 @@ -415,11 +409,10 @@
466 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
467 | tahoe-* \
468 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
469 - | tile*-* \
470 + | tile-* | tilegx-* \
471 | tron-* \
472 | ubicom32-* \
473 - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
474 - | vax-* \
475 + | v850-* | v850e-* | vax-* \
476 | we32k-* \
477 | x86-* | x86_64-* | xc16x-* | xps100-* \
478 | xstormy16-* | xtensa*-* \
479 @@ -820,10 +813,6 @@
480 basic_machine=i370-ibm
481 os=-mvs
483 - nacl)
484 - basic_machine=le32-unknown
485 - os=-nacl
486 - ;;
487 ncr3000)
488 basic_machine=i486-ncr
489 os=-sysv4
490 @@ -1132,8 +1121,13 @@
491 basic_machine=t90-cray
492 os=-unicos
494 + # This must be matched before tile*.
495 + tilegx*)
496 + basic_machine=tilegx-unknown
497 + os=-linux-gnu
498 + ;;
499 tile*)
500 - basic_machine=$basic_machine-unknown
501 + basic_machine=tile-unknown
502 os=-linux-gnu
504 tx39)
505 @@ -1346,6 +1340,7 @@
506 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
507 | -mingw32* | -linux-gnu* | -linux-android* \
508 | -linux-newlib* | -linux-uclibc* \
509 + | -linux-musl* \
510 | -uxpv* | -beos* | -mpeix* | -udk* \
511 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
512 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
513 # HG changeset patch
514 # Parent 25a391accb84b5095ace7eef6873d84737fb1df9
515 Support for i386-linux-musl and x86_64-linux-musl.
517 diff -r 25a391accb84 gcc/config/i386/linux.h
518 --- a/gcc/config/i386/linux.h Fri Dec 25 15:06:44 2015 -0500
519 +++ b/gcc/config/i386/linux.h Fri Dec 25 15:06:47 2015 -0500
520 @@ -22,3 +22,4 @@
522 #define GNU_USER_LINK_EMULATION "elf_i386"
523 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
524 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
525 diff -r 25a391accb84 gcc/config/i386/linux64.h
526 --- a/gcc/config/i386/linux64.h Fri Dec 25 15:06:44 2015 -0500
527 +++ b/gcc/config/i386/linux64.h Fri Dec 25 15:06:47 2015 -0500
528 @@ -31,3 +31,7 @@
529 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
530 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
531 #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
533 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
534 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
535 +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
536 diff -r 25a391accb84 libitm/config/linux/x86/tls.h
537 --- a/libitm/config/linux/x86/tls.h Fri Dec 25 15:06:44 2015 -0500
538 +++ b/libitm/config/linux/x86/tls.h Fri Dec 25 15:06:47 2015 -0500
539 @@ -25,16 +25,19 @@
540 #ifndef LIBITM_X86_TLS_H
541 #define LIBITM_X86_TLS_H 1
543 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
544 +#if defined(__GLIBC_PREREQ)
545 +#if __GLIBC_PREREQ(2, 10)
546 /* Use slots in the TCB head rather than __thread lookups.
547 GLIBC has reserved words 10 through 13 for TM. */
548 #define HAVE_ARCH_GTM_THREAD 1
549 #define HAVE_ARCH_GTM_THREAD_DISP 1
550 #endif
551 +#endif
553 #include "config/generic/tls.h"
555 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
556 +#if defined(__GLIBC_PREREQ)
557 +#if __GLIBC_PREREQ(2, 10)
558 namespace GTM HIDDEN {
560 #ifdef __x86_64__
561 @@ -101,5 +104,6 @@
563 } // namespace GTM
564 #endif /* >= GLIBC 2.10 */
565 +#endif
567 #endif // LIBITM_X86_TLS_H
568 Support for arm-linux-musl.
570 diff -r c45640afa341 gcc/config/arm/linux-eabi.h
571 --- a/gcc/config/arm/linux-eabi.h Fri Dec 25 15:06:47 2015 -0500
572 +++ b/gcc/config/arm/linux-eabi.h Fri Dec 25 15:06:51 2015 -0500
573 @@ -64,6 +64,23 @@
574 #undef GLIBC_DYNAMIC_LINKER
575 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
577 +/* For ARM musl currently supports four dynamic linkers:
578 + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
579 + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
580 + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
581 + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
582 + musl does not support the legacy OABI mode.
583 + All the dynamic linkers live in /lib.
584 + We default to soft-float, EL. */
585 +#undef MUSL_DYNAMIC_LINKER
586 +#if TARGET_BIG_ENDIAN_DEFAULT
587 +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
588 +#else
589 +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
590 +#endif
591 +#define MUSL_DYNAMIC_LINKER \
592 + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
594 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
595 use the GNU/Linux version, not the generic BPABI version. */
596 #undef LINK_SPEC
597 diff -r c45640afa341 libitm/config/arm/hwcap.cc
598 --- a/libitm/config/arm/hwcap.cc Fri Dec 25 15:06:47 2015 -0500
599 +++ b/libitm/config/arm/hwcap.cc Fri Dec 25 15:06:51 2015 -0500
600 @@ -40,7 +40,11 @@
602 #ifdef __linux__
603 #include <unistd.h>
604 +#ifdef __GLIBC__
605 #include <sys/fcntl.h>
606 +#else
607 +#include <fcntl.h>
608 +#endif
609 #include <elf.h>
611 static void __attribute__((constructor))
612 # HG changeset patch
613 # Parent a8d9328e702eab78a69a3ee8f364de5450098b61
614 Support for mips-linux-musl.
616 diff -r a8d9328e702e gcc/config/mips/linux.h
617 --- a/gcc/config/mips/linux.h Fri Dec 25 15:06:51 2015 -0500
618 +++ b/gcc/config/mips/linux.h Fri Dec 25 15:06:54 2015 -0500
619 @@ -19,3 +19,10 @@
620 <http://www.gnu.org/licenses/>. */
622 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
624 +#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
625 +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
626 +#else
627 +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
628 +#endif
629 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
630 # HG changeset patch
631 # Parent 2f0263e2cdd9e9adeab9ab40259bdf92fb7abf92
632 Support for powerpc-linux-musl.
634 diff -r 2f0263e2cdd9 gcc/config.gcc
635 --- a/gcc/config.gcc Fri Dec 25 15:06:54 2015 -0500
636 +++ b/gcc/config.gcc Fri Dec 25 15:06:57 2015 -0500
637 @@ -2094,6 +2094,10 @@
638 powerpc*-*-linux*paired*)
639 tm_file="${tm_file} rs6000/750cl.h" ;;
640 esac
641 + case ${target} in
642 + *-linux*-musl*)
643 + enable_secureplt=yes ;;
644 + esac
645 if test x${enable_secureplt} = xyes; then
646 tm_file="rs6000/secureplt.h ${tm_file}"
648 diff -r 2f0263e2cdd9 gcc/config/rs6000/linux64.h
649 --- a/gcc/config/rs6000/linux64.h Fri Dec 25 15:06:54 2015 -0500
650 +++ b/gcc/config/rs6000/linux64.h Fri Dec 25 15:06:57 2015 -0500
651 @@ -362,17 +362,21 @@
652 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
653 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
654 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
655 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
656 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
657 #if DEFAULT_LIBC == LIBC_UCLIBC
658 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
659 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
660 #elif DEFAULT_LIBC == LIBC_GLIBC
661 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
662 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
663 +#elif DEFAULT_LIBC == LIBC_MUSL
664 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
665 #else
666 #error "Unsupported DEFAULT_LIBC"
667 #endif
668 #define GNU_USER_DYNAMIC_LINKER32 \
669 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
670 + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
671 #define GNU_USER_DYNAMIC_LINKER64 \
672 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
673 + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
676 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
677 diff -r 2f0263e2cdd9 gcc/config/rs6000/secureplt.h
678 --- a/gcc/config/rs6000/secureplt.h Fri Dec 25 15:06:54 2015 -0500
679 +++ b/gcc/config/rs6000/secureplt.h Fri Dec 25 15:06:57 2015 -0500
680 @@ -18,3 +18,4 @@
681 <http://www.gnu.org/licenses/>. */
683 #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
684 +#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
685 diff -r 2f0263e2cdd9 gcc/config/rs6000/sysv4.h
686 --- a/gcc/config/rs6000/sysv4.h Fri Dec 25 15:06:54 2015 -0500
687 +++ b/gcc/config/rs6000/sysv4.h Fri Dec 25 15:06:57 2015 -0500
688 @@ -566,6 +566,9 @@
689 #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
690 #define CC1_SECURE_PLT_DEFAULT_SPEC ""
691 #endif
692 +#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
693 +#define LINK_SECURE_PLT_DEFAULT_SPEC ""
694 +#endif
696 /* Pass -G xxx to the compiler and set correct endian mode. */
697 #define CC1_SPEC "%{G*} %(cc1_cpu) \
698 @@ -626,7 +629,8 @@
699 %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
700 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
701 %{mcall-i960-old: --oformat elf32-powerpcle} \
702 - }}}}"
703 + }}}} \
704 +%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
706 /* Any specific OS flags. */
707 #define LINK_OS_SPEC "\
708 @@ -804,15 +808,18 @@
710 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
711 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
712 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
713 #if DEFAULT_LIBC == LIBC_UCLIBC
714 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
715 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
716 +#elif DEFAULT_LIBC == LIBC_MUSL
717 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
718 #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
719 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
720 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
721 #else
722 #error "Unsupported DEFAULT_LIBC"
723 #endif
724 #define GNU_USER_DYNAMIC_LINKER \
725 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
726 + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
728 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
729 %{rdynamic:-export-dynamic} \
730 @@ -938,6 +945,7 @@
731 { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
732 { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
733 { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
734 + { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
735 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
736 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
737 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
738 diff -r 2f0263e2cdd9 libgcc/config/rs6000/linux-unwind.h
739 --- a/libgcc/config/rs6000/linux-unwind.h Fri Dec 25 15:06:54 2015 -0500
740 +++ b/libgcc/config/rs6000/linux-unwind.h Fri Dec 25 15:06:57 2015 -0500
741 @@ -176,6 +176,7 @@
743 #endif
745 +#ifdef __GLIBC__
746 /* Find an entry in the process auxiliary vector. The canonical way to
747 test for VMX is to look at AT_HWCAP. */
749 @@ -207,6 +208,7 @@
750 return auxp->a_val;
751 return 0;
753 +#endif
755 /* Do code reading to identify a signal frame, and set the frame
756 state data appropriately. See unwind-dw2.c for the structs. */
757 @@ -253,7 +255,11 @@
759 if (hwcap == 0)
761 +#ifdef __GLIBC__
762 hwcap = ppc_linux_aux_vector (16);
763 +#else
764 + hwcap = -1;
765 +#endif
766 /* These will already be set if we found AT_HWCAP. A nonzero
767 value stops us looking again if for some reason we couldn't
768 find AT_HWCAP. */
769 diff -r 900652b2bfdc gcc/gcc.c
770 --- a/gcc/gcc.c Fri Dec 25 15:06:57 2015 -0500
771 +++ b/gcc/gcc.c Fri Dec 25 15:07:00 2015 -0500
772 @@ -603,7 +603,7 @@
774 #ifndef LINK_SSP_SPEC
775 #ifdef TARGET_LIBC_PROVIDES_SSP
776 -#define LINK_SSP_SPEC "%{fstack-protector:}"
777 +#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
778 #else
779 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
780 #endif
781 Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
782 wrong warning when using the universal zero initializer {0}
784 Backported to GCC 4.7.4
786 Subject: 2014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
787 X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/95cdf3fdf2d440eb7775def8e35ab970651c33d9?hp=14a3093e9943937cbc63dfbf4d51ca60f8325b29
788 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211289 138bc75d-0d04-0410-961f-82ee72b054a4
790 diff -r ba71a4c285bf gcc/c-typeck.c
791 --- a/gcc/c-typeck.c Fri Dec 25 15:07:00 2015 -0500
792 +++ b/gcc/c-typeck.c Fri Dec 25 15:07:03 2015 -0500
793 @@ -68,9 +68,9 @@
794 /* The level of nesting inside "typeof". */
795 int in_typeof;
797 -/* Nonzero if we've already printed a "missing braces around initializer"
798 - message within this initializer. */
799 -static int missing_braces_mentioned;
800 +/* Nonzero if we might need to print a "missing braces around
801 + initializer" message within this initializer. */
802 +static int found_missing_braces;
804 static int require_constant_value;
805 static int require_constant_elements;
806 @@ -6455,6 +6455,9 @@
807 /* 1 if this constructor is erroneous so far. */
808 static int constructor_erroneous;
810 +/* 1 if this constructor is the universal zero initializer { 0 }. */
811 +static int constructor_zeroinit;
813 /* Structure for managing pending initializer elements, organized as an
814 AVL tree. */
816 @@ -6616,7 +6619,7 @@
817 constructor_stack = 0;
818 constructor_range_stack = 0;
820 - missing_braces_mentioned = 0;
821 + found_missing_braces = 0;
823 spelling_base = 0;
824 spelling_size = 0;
825 @@ -6711,6 +6714,7 @@
826 constructor_type = type;
827 constructor_incremental = 1;
828 constructor_designated = 0;
829 + constructor_zeroinit = 1;
830 designator_depth = 0;
831 designator_erroneous = 0;
833 @@ -6908,11 +6912,8 @@
834 set_nonincremental_init (braced_init_obstack);
837 - if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
839 - missing_braces_mentioned = 1;
840 - warning_init (OPT_Wmissing_braces, "missing braces around initializer");
842 + if (implicit == 1)
843 + found_missing_braces = 1;
845 if (TREE_CODE (constructor_type) == RECORD_TYPE
846 || TREE_CODE (constructor_type) == UNION_TYPE)
847 @@ -7045,17 +7046,23 @@
851 + if (VEC_length (constructor_elt, constructor_elements) != 1)
852 + constructor_zeroinit = 0;
854 + /* Warn when some structs are initialized with direct aggregation. */
855 + if (!implicit && found_missing_braces && warn_missing_braces
856 + && !constructor_zeroinit)
858 + warning_init (OPT_Wmissing_braces,
859 + "missing braces around initializer");
862 /* Warn when some struct elements are implicitly initialized to zero. */
863 if (warn_missing_field_initializers
864 && constructor_type
865 && TREE_CODE (constructor_type) == RECORD_TYPE
866 && constructor_unfilled_fields)
868 - bool constructor_zeroinit =
869 - (VEC_length (constructor_elt, constructor_elements) == 1
870 - && integer_zerop
871 - (VEC_index (constructor_elt, constructor_elements, 0)->value));
873 /* Do not warn for flexible array members or zero-length arrays. */
874 while (constructor_unfilled_fields
875 && (!DECL_SIZE (constructor_unfilled_fields)
876 @@ -8170,6 +8177,9 @@
877 designator_depth = 0;
878 designator_erroneous = 0;
880 + if (!implicit && value.value && !integer_zerop (value.value))
881 + constructor_zeroinit = 0;
883 /* Handle superfluous braces around string cst as in
884 char x[] = {"foo"}; */
885 if (string_flag