1 diff -r d6f84a2db6ba config.sub
2 --- a/config.sub Mon Mar 11 17:14:07 2013 -0400
3 +++ b/config.sub Mon Mar 11 18:34:53 2013 -0400
5 # Here we must recognize all the valid KERNEL-OS combinations.
6 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
8 - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
9 + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | linux-musl* | uclinux-uclibc* | uclinux-gnu* | \
10 kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
12 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
14 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
15 | -chorusos* | -chorusrdb* \
16 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
17 - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
18 + | -mingw32* | -linux-gnu* | -linux-uclibc* | -linux-musl* | -uxpv* | -beos* | -mpeix* | -udk* \
19 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
20 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
21 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
22 diff -r d6f84a2db6ba gcc/config.gcc
23 --- a/gcc/config.gcc Mon Mar 11 17:14:07 2013 -0400
24 +++ b/gcc/config.gcc Mon Mar 11 18:34:53 2013 -0400
26 "" | yes | posix) thread_file='posix' ;;
28 tmake_file="t-slibgcc-elf-ver t-linux"
31 + tm_defines="${tm_defines} MUSL_LIBC=1"
34 + tm_defines="${tm_defines} MUSL_LIBC=0"
39 # On the Hurd, the setup is just about the same on
40 diff -r d6f84a2db6ba gcc/config/i386/linux.h
41 --- a/gcc/config/i386/linux.h Mon Mar 11 17:14:07 2013 -0400
42 +++ b/gcc/config/i386/linux.h Mon Mar 11 18:34:53 2013 -0400
44 /* If ELF is the default format, we should not use /lib/elf. */
46 #define LINK_EMULATION "elf_i386"
48 #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
50 +#define DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
53 #undef SUBTARGET_EXTRA_SPECS
54 #define SUBTARGET_EXTRA_SPECS \
55 diff -r d6f84a2db6ba gcc/config/i386/linux64.h
56 --- a/gcc/config/i386/linux64.h Mon Mar 11 17:14:07 2013 -0400
57 +++ b/gcc/config/i386/linux64.h Mon Mar 11 18:34:53 2013 -0400
63 #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
67 %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
68 %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
71 +#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
75 + %{rdynamic:-export-dynamic} \
76 + %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-musl-i386.so.1}} \
77 + %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-musl-x86_64.so.1}}} \
81 #define MULTILIB_DEFAULTS { "m64" }
83 diff -r d6f84a2db6ba gcc/config/mips/linux.h
84 --- a/gcc/config/mips/linux.h Mon Mar 11 17:14:07 2013 -0400
85 +++ b/gcc/config/mips/linux.h Mon Mar 11 18:34:53 2013 -0400
87 #undef MIPS_DEFAULT_GVALUE
88 #define MIPS_DEFAULT_GVALUE 0
90 +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
92 /* Borrowed from sparc/linux.h */
95 diff -r d6f84a2db6ba gcc/ginclude/stddef.h
96 --- a/gcc/ginclude/stddef.h Mon Mar 11 17:14:07 2013 -0400
97 +++ b/gcc/ginclude/stddef.h Mon Mar 11 18:34:53 2013 -0400
102 +#ifndef __DEFINED_size_t /* musl */
103 #define __size_t__ /* BeOS */
104 #define __SIZE_T__ /* Cray Unicos/Mk */
107 #define ___int_size_t_h
110 +#define __DEFINED_size_t /* musl */
111 #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
112 /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
115 typedef long ssize_t;
116 #endif /* __BEOS__ */
117 #endif /* !(defined (__GNUG__) && defined (size_t)) */
118 +#endif /* __DEFINED_size_t */
119 #endif /* __size_t */
121 #endif /* _GCC_SIZE_T */
122 diff -r d6f84a2db6ba libstdc++-v3/configure
123 --- a/libstdc++-v3/configure Mon Mar 11 17:14:07 2013 -0400
124 +++ b/libstdc++-v3/configure Mon Mar 11 18:34:53 2013 -0400
125 @@ -84175,6 +84175,8 @@
131 cat >>confdefs.h <<\_ACEOF
132 #define HAVE_FINITE 1
134 @@ -84182,6 +84184,8 @@
135 cat >>confdefs.h <<\_ACEOF
136 #define HAVE_FINITEF 1
141 cat >>confdefs.h <<\_ACEOF
142 #define HAVE_FLOORF 1
143 diff -r d6f84a2db6ba libstdc++-v3/configure.host
144 --- a/libstdc++-v3/configure.host Mon Mar 11 17:14:07 2013 -0400
145 +++ b/libstdc++-v3/configure.host Mon Mar 11 18:34:53 2013 -0400
147 os_include_dir="os/bsd/freebsd"
149 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
150 + # check for musl by target
151 + case "${host_os}" in
153 + os_include_dir="os/generic"
157 os_include_dir="os/gnu-linux"
163 os_include_dir="os/hpux"