|
@@ -1,16 +1,6 @@
|
1
|
|
---- a/config.sub
|
2
|
|
-+++ b/config.sub
|
3
|
|
-@@ -125,6 +125,7 @@ esac
|
4
|
|
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
5
|
|
- case $maybe_os in
|
6
|
|
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
7
|
|
-+ linux-musl* | \
|
8
|
|
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
9
|
|
- knetbsd*-gnu* | netbsd*-gnu* | \
|
10
|
|
- kopensolaris*-gnu* | \
|
11
|
1
|
--- a/gcc/config.gcc
|
12
|
2
|
+++ b/gcc/config.gcc
|
13
|
|
-@@ -485,7 +485,7 @@ case ${target} in
|
|
3
|
+@@ -549,7 +549,7 @@ case ${target} in
|
14
|
4
|
esac
|
15
|
5
|
|
16
|
6
|
# Common C libraries.
|
|
@@ -19,7 +9,7 @@
|
19
|
9
|
|
20
|
10
|
# Common parts for widely ported systems.
|
21
|
11
|
case ${target} in
|
22
|
|
-@@ -598,6 +598,9 @@ case ${target} in
|
|
12
|
+@@ -652,6 +652,9 @@ case ${target} in
|
23
|
13
|
*-*-*uclibc*)
|
24
|
14
|
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
|
25
|
15
|
;;
|
|
@@ -31,7 +21,7 @@
|
31
|
21
|
;;
|
32
|
22
|
--- a/gcc/config/arm/linux-eabi.h
|
33
|
23
|
+++ b/gcc/config/arm/linux-eabi.h
|
34
|
|
-@@ -78,6 +78,10 @@
|
|
24
|
+@@ -77,6 +77,10 @@
|
35
|
25
|
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
|
36
|
26
|
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
|
37
|
27
|
|
|
@@ -44,29 +34,24 @@
|
44
|
34
|
#undef LINK_SPEC
|
45
|
35
|
--- a/gcc/config/i386/linux.h
|
46
|
36
|
+++ b/gcc/config/i386/linux.h
|
47
|
|
-@@ -93,6 +93,7 @@ along with GCC; see the file COPYING3.
|
48
|
|
- /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */
|
49
|
|
- #define LINK_EMULATION "elf_i386"
|
|
37
|
+@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3.
|
|
38
|
+
|
|
39
|
+ #define GNU_USER_LINK_EMULATION "elf_i386"
|
50
|
40
|
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
51
|
41
|
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
|
52
|
|
-
|
53
|
|
- #undef ASM_SPEC
|
54
|
|
- #define ASM_SPEC \
|
55
|
42
|
--- a/gcc/config/i386/linux64.h
|
56
|
43
|
+++ b/gcc/config/i386/linux64.h
|
57
|
|
-@@ -65,6 +65,9 @@ see the files COPYING3 and COPYING.RUNTI
|
|
44
|
+@@ -30,3 +30,7 @@ see the files COPYING3 and COPYING.RUNTI
|
58
|
45
|
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
|
59
|
46
|
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
|
60
|
|
-
|
|
47
|
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
|
|
48
|
++
|
61
|
49
|
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
|
62
|
50
|
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
|
63
|
|
-+
|
64
|
|
- #if TARGET_64BIT_DEFAULT
|
65
|
|
- #define SPEC_32 "m32"
|
66
|
|
- #define SPEC_64 "!m32"
|
|
51
|
++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
|
67
|
52
|
--- a/gcc/config/linux.h
|
68
|
53
|
+++ b/gcc/config/linux.h
|
69
|
|
-@@ -33,10 +33,12 @@ see the files COPYING3 and COPYING.RUNTI
|
|
54
|
+@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI
|
70
|
55
|
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
71
|
56
|
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
72
|
57
|
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
|
@@ -78,8 +63,8 @@
|
78
|
63
|
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
79
|
64
|
#endif
|
80
|
65
|
|
81
|
|
- #define LINUX_TARGET_OS_CPP_BUILTINS() \
|
82
|
|
-@@ -54,18 +56,21 @@ see the files COPYING3 and COPYING.RUNTI
|
|
66
|
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
|
|
67
|
+@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTI
|
83
|
68
|
uClibc or Bionic is the default C library and whether
|
84
|
69
|
-muclibc or -mglibc or -mbionic has been passed to change the default. */
|
85
|
70
|
|
|
@@ -109,20 +94,24 @@
|
109
|
94
|
#else
|
110
|
95
|
#error "Unsupported DEFAULT_LIBC"
|
111
|
96
|
#endif /* DEFAULT_LIBC */
|
112
|
|
-@@ -83,13 +88,13 @@ see the files COPYING3 and COPYING.RUNTI
|
|
97
|
+@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTI
|
113
|
98
|
|
114
|
|
- #define LINUX_DYNAMIC_LINKER \
|
|
99
|
+ #define GNU_USER_DYNAMIC_LINKER \
|
115
|
100
|
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
|
116
|
101
|
- BIONIC_DYNAMIC_LINKER)
|
117
|
102
|
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
|
118
|
|
- #define LINUX_DYNAMIC_LINKER32 \
|
|
103
|
+ #define GNU_USER_DYNAMIC_LINKER32 \
|
119
|
104
|
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
|
120
|
105
|
- BIONIC_DYNAMIC_LINKER32)
|
121
|
106
|
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
|
122
|
|
- #define LINUX_DYNAMIC_LINKER64 \
|
|
107
|
+ #define GNU_USER_DYNAMIC_LINKER64 \
|
123
|
108
|
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
|
124
|
109
|
- BIONIC_DYNAMIC_LINKER64)
|
125
|
110
|
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
|
|
111
|
+ #define GNU_USER_DYNAMIC_LINKERX32 \
|
|
112
|
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
|
|
113
|
+- BIONIC_DYNAMIC_LINKERX32)
|
|
114
|
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
|
126
|
115
|
|
127
|
116
|
/* Determine whether the entire c99 runtime
|
128
|
117
|
is present in the runtime library. */
|
|
@@ -138,18 +127,67 @@
|
138
|
127
|
+Use musl C library
|
139
|
128
|
--- a/gcc/config/mips/linux.h
|
140
|
129
|
+++ b/gcc/config/mips/linux.h
|
141
|
|
-@@ -63,6 +63,8 @@ along with GCC; see the file COPYING3.
|
|
130
|
+@@ -18,3 +18,5 @@ along with GCC; see the file COPYING3.
|
|
131
|
+ <http://www.gnu.org/licenses/>. */
|
142
|
132
|
|
143
|
133
|
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
144
|
|
-
|
145
|
|
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
|
146
|
134
|
+
|
147
|
|
- /* Borrowed from sparc/linux.h */
|
148
|
|
- #undef LINK_SPEC
|
149
|
|
- #define LINK_SPEC \
|
|
135
|
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
|
|
136
|
+--- a/gcc/config/rs6000/linux64.h
|
|
137
|
++++ b/gcc/config/rs6000/linux64.h
|
|
138
|
+@@ -364,17 +364,21 @@ extern int dot_symbols;
|
|
139
|
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
|
|
140
|
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
|
|
141
|
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
|
|
142
|
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
|
|
143
|
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
|
|
144
|
+ #if DEFAULT_LIBC == LIBC_UCLIBC
|
|
145
|
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
|
|
146
|
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
|
|
147
|
+ #elif DEFAULT_LIBC == LIBC_GLIBC
|
|
148
|
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
|
|
149
|
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
|
|
150
|
++#elif DEFAULT_LIBC == LIBC_MUSL
|
|
151
|
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
|
|
152
|
+ #else
|
|
153
|
+ #error "Unsupported DEFAULT_LIBC"
|
|
154
|
+ #endif
|
|
155
|
+ #define GNU_USER_DYNAMIC_LINKER32 \
|
|
156
|
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
|
|
157
|
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
|
|
158
|
+ #define GNU_USER_DYNAMIC_LINKER64 \
|
|
159
|
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
|
|
160
|
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+ #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
|
|
164
|
+--- a/gcc/config/rs6000/sysv4.h
|
|
165
|
++++ b/gcc/config/rs6000/sysv4.h
|
|
166
|
+@@ -789,15 +789,18 @@ extern int fixuplabelno;
|
|
167
|
+
|
|
168
|
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
|
169
|
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
|
|
170
|
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
|
|
171
|
+ #if DEFAULT_LIBC == LIBC_UCLIBC
|
|
172
|
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
|
|
173
|
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
|
|
174
|
++#elif DEFAULT_LIBC == LIBC_MUSL
|
|
175
|
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
|
|
176
|
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
|
|
177
|
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
|
|
178
|
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
|
|
179
|
+ #else
|
|
180
|
+ #error "Unsupported DEFAULT_LIBC"
|
|
181
|
+ #endif
|
|
182
|
+ #define GNU_USER_DYNAMIC_LINKER \
|
|
183
|
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
|
|
184
|
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
|
|
185
|
+
|
|
186
|
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
|
187
|
+ %{rdynamic:-export-dynamic} \
|
150
|
188
|
--- a/gcc/ginclude/stddef.h
|
151
|
189
|
+++ b/gcc/ginclude/stddef.h
|
152
|
|
-@@ -184,6 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
190
|
+@@ -181,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
153
|
191
|
#ifndef _GCC_SIZE_T
|
154
|
192
|
#ifndef _SIZET_
|
155
|
193
|
#ifndef __size_t
|
|
@@ -157,14 +195,14 @@
|
157
|
195
|
#define __size_t__ /* BeOS */
|
158
|
196
|
#define __SIZE_T__ /* Cray Unicos/Mk */
|
159
|
197
|
#define _SIZE_T
|
160
|
|
-@@ -200,6 +201,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
198
|
+@@ -197,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
161
|
199
|
#define ___int_size_t_h
|
162
|
200
|
#define _GCC_SIZE_T
|
163
|
201
|
#define _SIZET_
|
164
|
202
|
+#define __DEFINED_size_t /* musl */
|
165
|
|
- #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
|
166
|
|
- /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
|
167
|
|
- #else
|
|
203
|
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|
|
204
|
+ || defined(__FreeBSD_kernel__)
|
|
205
|
+ /* __size_t is a typedef on FreeBSD 5, must not trash it. */
|
168
|
206
|
@@ -214,6 +216,7 @@ typedef __SIZE_TYPE__ size_t;
|
169
|
207
|
typedef long ssize_t;
|
170
|
208
|
#endif /* __BEOS__ */
|
|
@@ -184,9 +222,54 @@
|
184
|
222
|
#include "libgomp.h"
|
185
|
223
|
#include <unistd.h>
|
186
|
224
|
#if TIME_WITH_SYS_TIME
|
|
225
|
+--- a/libitm/config/arm/hwcap.cc
|
|
226
|
++++ b/libitm/config/arm/hwcap.cc
|
|
227
|
+@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
|
|
228
|
+
|
|
229
|
+ #ifdef __linux__
|
|
230
|
+ #include <unistd.h>
|
|
231
|
++#ifdef __GLIBC__
|
|
232
|
+ #include <sys/fcntl.h>
|
|
233
|
++#else
|
|
234
|
++#include <fcntl.h>
|
|
235
|
++#endif
|
|
236
|
+ #include <elf.h>
|
|
237
|
+
|
|
238
|
+ static void __attribute__((constructor))
|
|
239
|
+--- a/libitm/config/linux/x86/tls.h
|
|
240
|
++++ b/libitm/config/linux/x86/tls.h
|
|
241
|
+@@ -25,16 +25,19 @@
|
|
242
|
+ #ifndef LIBITM_X86_TLS_H
|
|
243
|
+ #define LIBITM_X86_TLS_H 1
|
|
244
|
+
|
|
245
|
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
|
|
246
|
++#if defined(__GLIBC_PREREQ)
|
|
247
|
++#if __GLIBC_PREREQ(2, 10)
|
|
248
|
+ /* Use slots in the TCB head rather than __thread lookups.
|
|
249
|
+ GLIBC has reserved words 10 through 13 for TM. */
|
|
250
|
+ #define HAVE_ARCH_GTM_THREAD 1
|
|
251
|
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
|
|
252
|
+ #endif
|
|
253
|
++#endif
|
|
254
|
+
|
|
255
|
+ #include "config/generic/tls.h"
|
|
256
|
+
|
|
257
|
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
|
|
258
|
++#if defined(__GLIBC_PREREQ)
|
|
259
|
++#if __GLIBC_PREREQ(2, 10)
|
|
260
|
+ namespace GTM HIDDEN {
|
|
261
|
+
|
|
262
|
+ #ifdef __x86_64__
|
|
263
|
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
|
|
264
|
+
|
|
265
|
+ } // namespace GTM
|
|
266
|
+ #endif /* >= GLIBC 2.10 */
|
|
267
|
++#endif
|
|
268
|
+
|
|
269
|
+ #endif // LIBITM_X86_TLS_H
|
187
|
270
|
--- a/libstdc++-v3/configure.host
|
188
|
271
|
+++ b/libstdc++-v3/configure.host
|
189
|
|
-@@ -237,6 +237,13 @@ case "${host_os}" in
|
|
272
|
+@@ -264,6 +264,13 @@ case "${host_os}" in
|
190
|
273
|
os_include_dir="os/bsd/freebsd"
|
191
|
274
|
;;
|
192
|
275
|
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
|
@@ -200,7 +283,7 @@
|
200
|
283
|
if [ "$uclibc" = "yes" ]; then
|
201
|
284
|
os_include_dir="os/uclibc"
|
202
|
285
|
elif [ "$bionic" = "yes" ]; then
|
203
|
|
-@@ -245,6 +252,9 @@ case "${host_os}" in
|
|
286
|
+@@ -272,6 +279,9 @@ case "${host_os}" in
|
204
|
287
|
os_include_dir="os/gnu-linux"
|
205
|
288
|
fi
|
206
|
289
|
;;
|
|
@@ -212,22 +295,19 @@
|
212
|
295
|
;;
|
213
|
296
|
--- a/gcc/config/mips/linux64.h
|
214
|
297
|
+++ b/gcc/config/mips/linux64.h
|
215
|
|
-@@ -40,9 +40,12 @@ along with GCC; see the file COPYING3.
|
|
298
|
+@@ -27,6 +27,9 @@ along with GCC; see the file COPYING3.
|
216
|
299
|
#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
|
217
|
300
|
#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
|
218
|
301
|
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
|
219
|
302
|
+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1"
|
220
|
303
|
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1"
|
221
|
304
|
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1"
|
222
|
|
- #define LINUX_DYNAMIC_LINKERN32 \
|
|
305
|
+ #define GNU_USER_DYNAMIC_LINKERN32 \
|
223
|
306
|
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
|
224
|
307
|
- BIONIC_DYNAMIC_LINKERN32)
|
225
|
308
|
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
|
226
|
|
-
|
227
|
|
- #undef LINK_SPEC
|
228
|
|
- #define LINK_SPEC "\
|
229
|
|
---- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100
|
230
|
|
-+++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100
|
|
309
|
+--- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100
|
|
310
|
++++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100
|
231
|
311
|
@@ -104,6 +104,9 @@
|
232
|
312
|
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
|
233
|
313
|
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
|
|
@@ -238,3 +318,4 @@
|
238
|
318
|
#ifdef SPARC_BI_ARCH
|
239
|
319
|
|
240
|
320
|
#undef SUBTARGET_EXTRA_SPECS
|
|
321
|
+
|