2 # Parent f50bb54f331f73405131a30b4f353cfda1c70304
3 Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
5 diff -r f50bb54f331f libstdc++-v3/configure.host
6 --- a/libstdc++-v3/configure.host Fri Mar 29 16:38:52 2013 -0400
7 +++ b/libstdc++-v3/configure.host Fri Mar 29 16:41:10 2013 -0400
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
15 + os_include_dir="os/generic"
19 if [ "$uclibc" = "yes" ]; then
20 os_include_dir="os/uclibc"
21 elif [ "$bionic" = "yes" ]; then
23 os_include_dir="os/gnu-linux"
30 os_include_dir="os/hpux"
33 # Parent 8cd76d5f6674f04c31523971d1dfc81c91388c38
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 8cd76d5f6674 gcc/config.gcc
37 --- a/gcc/config.gcc Mon Sep 09 12:54:21 2013 -0400
38 +++ b/gcc/config.gcc Mon Sep 09 12:54:37 2013 -0400
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.
50 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
53 + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
56 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
58 diff -r 8cd76d5f6674 gcc/config/linux.h
59 --- a/gcc/config/linux.h Mon Sep 09 12:54:21 2013 -0400
60 +++ b/gcc/config/linux.h Mon Sep 09 12:54:37 2013 -0400
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)
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)
73 #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
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)
102 #error "Unsupported DEFAULT_LIBC"
103 #endif /* DEFAULT_LIBC */
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
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 },
152 +#define INCLUDE_DEFAULTS_MUSL_LOCAL
155 +#ifdef PREFIX_INCLUDE_DIR
156 +#define INCLUDE_DEFAULTS_MUSL_PREFIX \
157 + { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
159 +#define INCLUDE_DEFAULTS_MUSL_PREFIX
162 +#ifdef CROSS_INCLUDE_DIR
163 +#define INCLUDE_DEFAULTS_MUSL_CROSS \
164 + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
166 +#define INCLUDE_DEFAULTS_MUSL_CROSS
169 +#ifdef TOOL_INCLUDE_DIR
170 +#define INCLUDE_DEFAULTS_MUSL_TOOL \
171 + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
173 +#define INCLUDE_DEFAULTS_MUSL_TOOL
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 },
181 +#define INCLUDE_DEFAULTS_MUSL_NATIVE
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
190 +# undef INCLUDE_DEFAULTS_MUSL_CROSS
191 +# define INCLUDE_DEFAULTS_MUSL_CROSS
194 +#undef INCLUDE_DEFAULTS
195 +#define INCLUDE_DEFAULTS \
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 } \
206 diff -r 8cd76d5f6674 gcc/config/linux.opt
207 --- a/gcc/config/linux.opt Mon Sep 09 12:54:21 2013 -0400
208 +++ b/gcc/config/linux.opt Mon Sep 09 12:54:37 2013 -0400
211 Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
215 +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
217 diff -r 8cd76d5f6674 gcc/ginclude/stddef.h
218 --- a/gcc/ginclude/stddef.h Mon Sep 09 12:54:21 2013 -0400
219 +++ b/gcc/ginclude/stddef.h Mon Sep 09 12:54:37 2013 -0400
224 +#ifndef __DEFINED_size_t /* musl */
225 #define __size_t__ /* BeOS */
226 #define __SIZE_T__ /* Cray Unicos/Mk */
229 #define ___int_size_t_h
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. */
237 typedef long ssize_t;
238 #endif /* __BEOS__ */
239 #endif /* !(defined (__GNUG__) && defined (size_t)) */
240 +#endif /* __DEFINED_size_t */
241 #endif /* __size_t */
243 #endif /* _GCC_SIZE_T */
245 # Parent 2b94537ce2496c88e7e797c617e5b95e8d7e4785
246 A fix for libgomp to correctly request a POSIX version for time support.
248 diff -r 2b94537ce249 libgomp/config/posix/time.c
249 --- a/libgomp/config/posix/time.c Fri Mar 29 16:41:14 2013 -0400
250 +++ b/libgomp/config/posix/time.c Fri Mar 29 16:41:17 2013 -0400
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 */
259 #if TIME_WITH_SYS_TIME
260 diff -r 2ebb44d1e6f1 libgcc/unwind-dw2-fde-dip.c
261 --- a/libgcc/unwind-dw2-fde-dip.c Sun Jul 28 12:15:47 2013 -0400
262 +++ b/libgcc/unwind-dw2-fde-dip.c Sun Jul 28 12:17:02 2013 -0400
264 #include "unwind-compat.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
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
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
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
291 +# define ElfW(type) Elf_##typ
292 +# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
293 +# define ElfW __ElfN
297 #if defined(USE_PT_GNU_EH_FRAME)
298 diff -r 75d9c38318a7 gcc/configure
299 --- a/gcc/configure Tue Sep 24 06:52:49 2013 -0400
300 +++ b/gcc/configure Tue Sep 24 06:54:33 2013 -0400
301 @@ -26736,6 +26736,9 @@
303 gcc_cv_libc_provides_ssp=no
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 @@ -26769,6 +26772,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 @@ -26851,6 +26855,9 @@
320 gcc_cv_target_dl_iterate_phdr=no
324 + gcc_cv_target_dl_iterate_phdr=yes
328 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
329 diff -r 75d9c38318a7 gcc/configure.ac
330 --- a/gcc/configure.ac Tue Sep 24 06:52:49 2013 -0400
331 +++ b/gcc/configure.ac Tue Sep 24 06:54:33 2013 -0400
332 @@ -4719,6 +4719,9 @@
333 gcc_cv_libc_provides_ssp,
334 [gcc_cv_libc_provides_ssp=no
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 @@ -4752,6 +4755,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 @@ -4817,6 +4821,9 @@
351 gcc_cv_target_dl_iterate_phdr=no
355 + gcc_cv_target_dl_iterate_phdr=yes
358 GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
359 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
361 # Parent 94e435662aff38e86c9ca0dff4bbf451e0190b34
362 Get rid of ever-broken fixincludes on musl.
365 diff -r 94e435662aff -r e27957848dc8 fixincludes/mkfixinc.sh
366 --- a/fixincludes/mkfixinc.sh Sat Jul 27 23:37:20 2013 -0400
367 +++ b/fixincludes/mkfixinc.sh Sat Jul 27 23:43:03 2013 -0400
371 powerpcle-*-eabisim* | \
372 - powerpcle-*-eabi* )
373 + powerpcle-*-eabi* | \
375 # IF there is no include fixing,
376 # THEN create a no-op fixer and exit
377 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
379 # Parent 65cd23493c45f2a531ca15ffea563d6110143cdd
380 New config.sub for GCC versions too early for the update.
383 diff -r 65cd23493c45 -r 355cec477536 config.sub
384 --- a/config.sub Tue Aug 27 15:49:27 2013 -0400
385 +++ b/config.sub Tue Aug 27 15:51:14 2013 -0400
387 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
388 # 2011 Free Software Foundation, Inc.
390 -timestamp='2011-10-29'
391 +timestamp='2011-03-23'
393 # This file is (in principle) common to ALL GNU software.
394 # The presence of a machine in this file suggests that SOME GNU software
396 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
398 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
400 linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
401 knetbsd*-gnu* | netbsd*-gnu* | \
402 kopensolaris*-gnu* | \
403 @@ -251,17 +252,13 @@
404 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
406 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
410 | d10v | d30v | dlx | dsp16xx \
412 | fido | fr30 | frv \
413 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
415 | i370 | i860 | i960 | ia64 \
419 | m32c | m32r | m32rle | m68000 | m68k | m88k \
420 | maxq | mb | microblaze | mcore | mep | metag \
422 | pdp10 | pdp11 | pj | pjl \
423 | powerpc | powerpc64 | powerpc64le | powerpcle \
428 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
432 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
434 - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
437 | x86 | xc16x | xstormy16 | xtensa \
440 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
441 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
443 - | be32-* | be64-* \
444 | bfin-* | bs2000-* \
445 | c[123]* | c30-* | [cjt]90-* | c4x-* \
446 | clipper-* | craynv-* | cydra-* \
448 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
449 | h8300-* | h8500-* \
450 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
452 | i*86-* | i860-* | i960-* | ia64-* \
453 | ip2k-* | iq2000-* \
454 - | le32-* | le64-* \
456 | m32c-* | m32r-* | m32rle-* \
457 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
459 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
460 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
462 - | rl78-* | romp-* | rs6000-* | rx-* \
463 + | romp-* | rs6000-* | rx-* \
464 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
465 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
466 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
467 @@ -415,11 +409,10 @@
468 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
470 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
472 + | tile-* | tilegx-* \
475 - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
477 + | v850-* | v850e-* | vax-* \
479 | x86-* | x86_64-* | xc16x-* | xps100-* \
480 | xstormy16-* | xtensa*-* \
482 basic_machine=i370-ibm
486 - basic_machine=le32-unknown
490 basic_machine=i486-ncr
492 @@ -1132,8 +1121,13 @@
493 basic_machine=t90-cray
496 + # This must be matched before tile*.
498 + basic_machine=tilegx-unknown
502 - basic_machine=$basic_machine-unknown
503 + basic_machine=tile-unknown
507 @@ -1346,6 +1340,7 @@
508 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
509 | -mingw32* | -linux-gnu* | -linux-android* \
510 | -linux-newlib* | -linux-uclibc* \
512 | -uxpv* | -beos* | -mpeix* | -udk* \
513 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
514 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
516 # Parent 3ea10cd626cb7abdfd56d3fe8d2c9ed58a82797b
517 Support for i386-linux-musl and x86_64-linux-musl.
519 diff -r 3ea10cd626cb gcc/config/i386/linux.h
520 --- a/gcc/config/i386/linux.h Fri Mar 29 16:41:17 2013 -0400
521 +++ b/gcc/config/i386/linux.h Fri Mar 29 16:41:20 2013 -0400
524 #define GNU_USER_LINK_EMULATION "elf_i386"
525 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
526 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
527 diff -r 3ea10cd626cb gcc/config/i386/linux64.h
528 --- a/gcc/config/i386/linux64.h Fri Mar 29 16:41:17 2013 -0400
529 +++ b/gcc/config/i386/linux64.h Fri Mar 29 16:41:20 2013 -0400
531 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
532 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
533 #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
535 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
536 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
537 +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
538 diff -r 3ea10cd626cb libitm/config/linux/x86/tls.h
539 --- a/libitm/config/linux/x86/tls.h Fri Mar 29 16:41:17 2013 -0400
540 +++ b/libitm/config/linux/x86/tls.h Fri Mar 29 16:41:20 2013 -0400
542 #ifndef LIBITM_X86_TLS_H
543 #define LIBITM_X86_TLS_H 1
545 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
546 +#if defined(__GLIBC_PREREQ)
547 +#if __GLIBC_PREREQ(2, 10)
548 /* Use slots in the TCB head rather than __thread lookups.
549 GLIBC has reserved words 10 through 13 for TM. */
550 #define HAVE_ARCH_GTM_THREAD 1
551 #define HAVE_ARCH_GTM_THREAD_DISP 1
555 #include "config/generic/tls.h"
557 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
558 +#if defined(__GLIBC_PREREQ)
559 +#if __GLIBC_PREREQ(2, 10)
560 namespace GTM HIDDEN {
566 #endif /* >= GLIBC 2.10 */
569 #endif // LIBITM_X86_TLS_H
570 Support for arm-linux-musl.
572 diff -r 8801a3f6d050 gcc/config/arm/linux-eabi.h
573 --- a/gcc/config/arm/linux-eabi.h Tue Aug 27 15:47:31 2013 -0400
574 +++ b/gcc/config/arm/linux-eabi.h Tue Aug 27 15:47:37 2013 -0400
576 #undef GLIBC_DYNAMIC_LINKER
577 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
579 +/* For ARM musl currently supports four dynamic linkers:
580 + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
581 + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
582 + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
583 + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
584 + musl does not support the legacy OABI mode.
585 + All the dynamic linkers live in /lib.
586 + We default to soft-float, EL. */
587 +#undef MUSL_DYNAMIC_LINKER
588 +#if TARGET_BIG_ENDIAN_DEFAULT
589 +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
591 +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
593 +#define MUSL_DYNAMIC_LINKER \
594 + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
596 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
597 use the GNU/Linux version, not the generic BPABI version. */
599 diff -r 8801a3f6d050 libitm/config/arm/hwcap.cc
600 --- a/libitm/config/arm/hwcap.cc Tue Aug 27 15:47:31 2013 -0400
601 +++ b/libitm/config/arm/hwcap.cc Tue Aug 27 15:47:37 2013 -0400
607 #include <sys/fcntl.h>
613 static void __attribute__((constructor))
615 # Parent 4618ad6f036f1e944a5262ae5875dcdf62c41f8b
616 Support for mips-linux-musl.
618 diff -r 4618ad6f036f gcc/config/mips/linux.h
619 --- a/gcc/config/mips/linux.h Thu Sep 19 08:56:47 2013 -0400
620 +++ b/gcc/config/mips/linux.h Thu Sep 19 09:08:11 2013 -0400
622 <http://www.gnu.org/licenses/>. */
624 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
626 +#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
627 +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
629 +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
631 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
633 # Parent 2ffe76b215fdb082cbbc262536077627757fa9bf
634 Support for powerpc-linux-musl.
636 diff -r 2ffe76b215fd gcc/config.gcc
637 --- a/gcc/config.gcc Fri Mar 29 16:41:26 2013 -0400
638 +++ b/gcc/config.gcc Fri Mar 29 16:41:28 2013 -0400
639 @@ -2112,6 +2112,10 @@
640 powerpc*-*-linux*paired*)
641 tm_file="${tm_file} rs6000/750cl.h" ;;
645 + enable_secureplt=yes ;;
647 if test x${enable_secureplt} = xyes; then
648 tm_file="rs6000/secureplt.h ${tm_file}"
650 diff -r 2ffe76b215fd gcc/config/rs6000/linux64.h
651 --- a/gcc/config/rs6000/linux64.h Fri Mar 29 16:41:26 2013 -0400
652 +++ b/gcc/config/rs6000/linux64.h Fri Mar 29 16:41:28 2013 -0400
653 @@ -364,17 +364,21 @@
654 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
655 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
656 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
657 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
658 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
659 #if DEFAULT_LIBC == LIBC_UCLIBC
660 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
661 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
662 #elif DEFAULT_LIBC == LIBC_GLIBC
663 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
664 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
665 +#elif DEFAULT_LIBC == LIBC_MUSL
666 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
668 #error "Unsupported DEFAULT_LIBC"
670 #define GNU_USER_DYNAMIC_LINKER32 \
671 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
672 + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
673 #define GNU_USER_DYNAMIC_LINKER64 \
674 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
675 + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
678 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
679 diff -r 2ffe76b215fd gcc/config/rs6000/secureplt.h
680 --- a/gcc/config/rs6000/secureplt.h Fri Mar 29 16:41:26 2013 -0400
681 +++ b/gcc/config/rs6000/secureplt.h Fri Mar 29 16:41:28 2013 -0400
683 <http://www.gnu.org/licenses/>. */
685 #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
686 +#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
687 diff -r 2ffe76b215fd gcc/config/rs6000/sysv4.h
688 --- a/gcc/config/rs6000/sysv4.h Fri Mar 29 16:41:26 2013 -0400
689 +++ b/gcc/config/rs6000/sysv4.h Fri Mar 29 16:41:28 2013 -0400
691 #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
692 #define CC1_SECURE_PLT_DEFAULT_SPEC ""
694 +#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
695 +#define LINK_SECURE_PLT_DEFAULT_SPEC ""
698 /* Pass -G xxx to the compiler and set correct endian mode. */
699 #define CC1_SPEC "%{G*} %(cc1_cpu) \
701 %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
702 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
703 %{mcall-i960-old: --oformat elf32-powerpcle} \
706 +%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
708 /* Any specific OS flags. */
709 #define LINK_OS_SPEC "\
710 @@ -789,15 +793,18 @@
712 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
713 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
714 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
715 #if DEFAULT_LIBC == LIBC_UCLIBC
716 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
717 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
718 +#elif DEFAULT_LIBC == LIBC_MUSL
719 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
720 #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
721 -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
722 +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
724 #error "Unsupported DEFAULT_LIBC"
726 #define GNU_USER_DYNAMIC_LINKER \
727 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
728 + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
730 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
731 %{rdynamic:-export-dynamic} \
733 { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
734 { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
735 { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
736 + { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
737 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
738 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
739 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \