Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-devel/gcc/files/5.4.0/, sys-devel/gcc/files/, sys-devel/gcc/files/4.9.4/, ...
Date: Sun, 14 Apr 2019 21:04:11
Message-Id: 1555275120.5e0db82084a8b77b39114b0f0e811f04b96c9fc6.blueness@gentoo
1 commit: 5e0db82084a8b77b39114b0f0e811f04b96c9fc6
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 14 20:52:00 2019 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 14 20:52:00 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=5e0db820
7
8 sys-devel/gcc: remove older versions
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11 Package-Manager: Portage-2.3.62, Repoman-2.3.11
12
13 sys-devel/gcc/Manifest | 10 -
14 sys-devel/gcc/files/4.9.4/boehm_gc.patch | 104 -----
15 sys-devel/gcc/files/4.9.4/gthread.patch | 37 --
16 sys-devel/gcc/files/4.9.4/posix_memalign.patch | 29 --
17 sys-devel/gcc/files/5.4.0/cilkrts.patch | 46 --
18 sys-devel/gcc/files/5.4.0/linker_path.patch | 213 ---------
19 sys-devel/gcc/files/5.4.0/musl.patch | 502 ---------------------
20 sys-devel/gcc/files/5.4.0/ppc-secure_plt.patch | 59 ---
21 sys-devel/gcc/files/6.3.0/musl.patch | 33 --
22 ...gcc-4.9.3-tree-vect-data-refs-correctness.patch | 11 -
23 sys-devel/gcc/files/gcc-5.4.0-pr68470.patch | 57 ---
24 sys-devel/gcc/files/gcc-5.4.0-pr70473.patch | 43 --
25 .../files/gcc-5.4.0-pr71696-CVE-2016-6131.patch | 252 -----------
26 sys-devel/gcc/files/gcc-7.2.0-pr69728.patch | 26 --
27 sys-devel/gcc/files/gcc-configure-LANG.patch | 64 ---
28 sys-devel/gcc/files/gcc-spec-env-r1.patch | 87 ----
29 sys-devel/gcc/files/gcc-spec-env.patch | 42 --
30 sys-devel/gcc/gcc-6.4.0-r1.ebuild | 35 --
31 sys-devel/gcc/gcc-7.3.0-r3.ebuild | 31 --
32 sys-devel/gcc/gcc-7.3.0-r6.ebuild | 31 --
33 sys-devel/gcc/gcc-7.4.0.ebuild | 31 --
34 sys-devel/gcc/gcc-8.2.0-r5.ebuild | 29 --
35 sys-devel/gcc/metadata.xml | 3 -
36 23 files changed, 1775 deletions(-)
37
38 diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
39 index 66937be..f5387fe 100644
40 --- a/sys-devel/gcc/Manifest
41 +++ b/sys-devel/gcc/Manifest
42 @@ -1,13 +1,3 @@
43 -DIST ecj-4.5.jar 1470676 BLAKE2B 793c10ba09fd8040c0e1181204141aea16780c9c9088e07126e00da2b510af2ad6f58d876357d7e98cbb02d783a3be434469d5de1df134ccb8cc508e45028d80 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e
44 -DIST gcc-6.4.0-patches-1.3.tar.bz2 13617 BLAKE2B 6bfb1d70397e6ca4359e5d190e36003c18c7a03a9be4f923461dcff11307601e6b3502a2e289585b53baeb919008d83c29ad24078f814aed9b331140e4687419 SHA512 91be7c8db0004cdd150fec0f8daa709374753d2f524c58087dcf45b6696dbd609972297e866f971fba1aa679464cf96a384dd111e104183c0939ab69add017b2
45 -DIST gcc-6.4.0-uclibc-patches-1.0.tar.bz2 1586 BLAKE2B 21f97a9e1c349b3d52def092a03e5a90533521da9af586be7ee527594f2d65745491ff8758d88c99a7ac215bde7ebf4e47a0a36cfcd7e66f70e0bebf2dadd922 SHA512 266dbe2bb53d892a24cd752d5c6833ea33f8df8b11b0471700ee53865243cd41f412f9bea8a369b474c9cd1435faff2e03902c7cb5638dd3ddcaa665aa2ec522
46 -DIST gcc-6.4.0.tar.xz 76156220 BLAKE2B 2018c338b28ea644cdd1b327cb0dfe7ee9aa2010357c93f7e71969f587c58d3fdfa2bb4c82a309490c48bc86924400022fa93f41dc6c4345878d1bc1d8204265 SHA512 02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90
47 -DIST gcc-7.3.0-patches-1.4.tar.bz2 8238 BLAKE2B 72a5dcb046558c8f5c3a75040fe24ce1106c43af7510d6febf667b4377cb9caea5ebe9e1287af90e4ebfffa3f3f22ca85f533acf57c2e2d896f92adc1659b9f5 SHA512 24ed0d82240426efb111bbf48913b96fdc824ae3aa5a653298a726ebe64a40791f484229bbab9cc58f73d658e0b4b83ccd13081cfbea6e1673ef1d076cca3b33
48 -DIST gcc-7.3.0-patches-1.8.tar.bz2 14435 BLAKE2B 3e5c1abad56ccd6e0aa7739cb7cd651ec07ef9bf25be554343f1fa0444f251de41bde5fe6f8bb9e85e3f7a5cf8b2b83515647d93d62f338fa7843581fcaff2f8 SHA512 4d9d76b3d47f1af4f23cae15278d165b22065a3d1512323d1e31b5e0cb47e4654733dc43fa11906a3bd18e827621c9a5ec62b73563f8e5ead663c29f7d0d7345
49 -DIST gcc-7.3.0.tar.xz 62462388 BLAKE2B dc8f132b21bd0543c3d9dd17557038aafe65675aa73c540954234a3c972b4c31c939149bd50183d072ab6c8d16919e19daeaaffd619ce2ccd62dbdf9a5bb3302 SHA512 ad41a7e4584e40e92cdf860bc0288500fbaf5dfb7e8c3fcabe9eba809c87bcfa85b46c19c19921b0cdf6d05483faede8287bb9ea120c0d1559449a70e602c8d4
50 -DIST gcc-7.4.0-patches-1.1.tar.bz2 8778 BLAKE2B 52b02b3c619b99912ee254599788abebe3963cf85e49b56166069318e340a8e271d767e82798e6062fc2a042a86a88da66ab95f2d9e42933ff17688d616a903f SHA512 02ec2eb2460e24cf46f7a04ca3b80ca120719389a54a740070e991d9c96b6fd55d1fa04eb4249fd3043edc9c0f6519b5babcce76036cd0146183512aaae2d573
51 -DIST gcc-7.4.0.tar.xz 62601888 BLAKE2B df91ec680d5389736d3a37a2d85cf2e12fbe87b642fdf4b332e67a043e00944aca00243cc6709f86abd92115cb5a78502146636395571d1ea4899531e15d5d0e SHA512 8864d8e4b97c2e1a4f17422f6e68120172ebefeab97b1757734f7185ca68a6b9a89011c6833c03fa454c17b0ac35b15e1d284881e6971035948ac6100f3aa45e
52 -DIST gcc-8.2.0-patches-1.6.tar.bz2 17138 BLAKE2B edbeba9c41972836de072955c0db51406603aaf0dbb5f84ac1c5d8d2d61a8df6d725356655b69e3678950a0dc6dacc1bc2bf56f3620d685fe5c32045b3893f96 SHA512 32e7bddb5ec288def1e5c79d58023d90e29d77e83b70e3f21a22f4da78061cc49184d92c43807bdfd56a5067cbb9a8cfbfcb514016662aa1a24d791c7bd87b6b
53 DIST gcc-8.2.0-patches-1.7.tar.bz2 18166 BLAKE2B 2aff918d253d76c9b7d76b2d82e85c42f2ab8717e73831965b3a0fcc92b1ceacd7aa0b433dd0c180ad16906cfe059c020b256d01271ef95a6e56b08d41f4acfe SHA512 5110b610a4c9116ecd91490f66e570c09217c6b4d18bf46af5e1a51ed043df188ce313bdae6ba670b8800842387c98c1b83b7e1e0c396cbce71e6726d81f589c
54 DIST gcc-8.2.0.tar.xz 63460876 BLAKE2B c5372b0bdfcd2729577dca287b294623b78c583491998404eb307768c573618bdaaedb7d9ae0e39ba41a62a14b9525dff0e3083285754b7f5bb9987ecf635185 SHA512 64898a165f67e136d802a92e7633bf1b06c85266027e52127ea025bf5fc2291b5e858288aac0bdba246e6cdf7c6ec88bc8e0e7f3f6f1985f4297710cafde56ed
55 DIST gcc-8.3.0-patches-1.0.tar.bz2 12278 BLAKE2B 793465c5de0af850c7f3017b3011e68f3bd1664e6ce3500a3dc3003d37c03fe81857698957770a135eadd395a7767fa804d354ecdcdeb1d83623280ca569d4ec SHA512 0efadd2481713992807fed2683666f1094b3757674754601c079569f3ef70cd7aed3cefc9f815f4e59a21d37e4e940c122df714e16f3878a5f966450c4273669
56
57 diff --git a/sys-devel/gcc/files/4.9.4/boehm_gc.patch b/sys-devel/gcc/files/4.9.4/boehm_gc.patch
58 deleted file mode 100644
59 index 75b921a..0000000
60 --- a/sys-devel/gcc/files/4.9.4/boehm_gc.patch
61 +++ /dev/null
62 @@ -1,104 +0,0 @@
63 -diff -Naur gcc-4.9.4.orig/boehm-gc/dyn_load.c gcc-4.9.4/boehm-gc/dyn_load.c
64 ---- gcc-4.9.4.orig/boehm-gc/dyn_load.c 2012-11-04 14:56:02.000000000 -0800
65 -+++ gcc-4.9.4/boehm-gc/dyn_load.c 2016-12-25 13:22:28.000677992 -0800
66 -@@ -459,10 +459,7 @@
67 - /* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
68 - /* versions. Thanks to Jakub Jelinek for most of the code. */
69 -
70 --# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
71 -- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
72 -- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
73 --
74 -+#if defined(LINUX)
75 - /* We have the header files for a glibc that includes dl_iterate_phdr. */
76 - /* It may still not be available in the library on the target system. */
77 - /* Thus we also treat it as a weak symbol. */
78 -diff -Naur gcc-4.9.4.orig/boehm-gc/include/private/gcconfig.h gcc-4.9.4/boehm-gc/include/private/gcconfig.h
79 ---- gcc-4.9.4.orig/boehm-gc/include/private/gcconfig.h 2013-12-21 12:42:39.000000000 -0800
80 -+++ gcc-4.9.4/boehm-gc/include/private/gcconfig.h 2016-12-25 13:22:28.001678000 -0800
81 -@@ -696,9 +696,7 @@
82 - # ifdef __ELF__
83 - # define DYNAMIC_LOADING
84 - # include <features.h>
85 --# if defined(__GLIBC__)&& __GLIBC__>=2
86 --# define SEARCH_FOR_DATA_START
87 --# else /* !GLIBC2 */
88 -+# if defined(__GLIBC__) && __GLIBC__ < 2
89 - extern char **__environ;
90 - # define DATASTART ((ptr_t)(&__environ))
91 - /* hideous kludge: __environ is the first */
92 -@@ -709,6 +707,8 @@
93 - /* would include .rodata, which may */
94 - /* contain large read-only data tables */
95 - /* that we'd rather not scan. */
96 -+# else
97 -+# define SEARCH_FOR_DATA_START
98 - # endif /* !GLIBC2 */
99 - extern int _end[];
100 - # define DATAEND (_end)
101 -@@ -1167,9 +1167,7 @@
102 - # define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
103 - # endif
104 - # include <features.h>
105 --# if defined(__GLIBC__) && __GLIBC__ >= 2
106 --# define SEARCH_FOR_DATA_START
107 --# else
108 -+# if defined(__GLIBC__) && __GLIBC__ < 2
109 - extern char **__environ;
110 - # define DATASTART ((ptr_t)(&__environ))
111 - /* hideous kludge: __environ is the first */
112 -@@ -1180,6 +1178,8 @@
113 - /* would include .rodata, which may */
114 - /* contain large read-only data tables */
115 - /* that we'd rather not scan. */
116 -+# else
117 -+# define SEARCH_FOR_DATA_START
118 - # endif
119 - extern int _end[];
120 - # define DATAEND (_end)
121 -@@ -1387,10 +1387,10 @@
122 - # define HBLKSIZE 4096
123 - # endif
124 - # define USE_GENERIC_PUSH_REGS
125 --# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
126 --# define LINUX_STACKBOTTOM
127 --# else
128 -+# if __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 || __GLIBC__ < 2
129 - # define STACKBOTTOM 0x80000000
130 -+# else
131 -+# define LINUX_STACKBOTTOM
132 - # endif
133 - # endif /* Linux */
134 - # ifdef EWS4800
135 -@@ -1904,9 +1904,7 @@
136 - # ifdef __ELF__
137 - # define DYNAMIC_LOADING
138 - # include <features.h>
139 --# if defined(__GLIBC__) && __GLIBC__ >= 2
140 --# define SEARCH_FOR_DATA_START
141 --# else
142 -+# if defined(__GLIBC__) && __GLIBC__ < 2
143 - extern char **__environ;
144 - # define DATASTART ((ptr_t)(&__environ))
145 - /* hideous kludge: __environ is the first */
146 -@@ -1917,6 +1915,8 @@
147 - /* would include .rodata, which may */
148 - /* contain large read-only data tables */
149 - /* that we'd rather not scan. */
150 -+# else
151 -+# define SEARCH_FOR_DATA_START
152 - # endif
153 - extern int _end[];
154 - # define DATAEND (_end)
155 -diff -Naur gcc-4.9.4.orig/boehm-gc/os_dep.c gcc-4.9.4/boehm-gc/os_dep.c
156 ---- gcc-4.9.4.orig/boehm-gc/os_dep.c 2013-03-06 07:08:58.000000000 -0800
157 -+++ gcc-4.9.4/boehm-gc/os_dep.c 2016-12-25 13:22:28.002678009 -0800
158 -@@ -26,7 +26,7 @@
159 - # define __KERNEL__
160 - # include <asm/signal.h>
161 - # undef __KERNEL__
162 --# else
163 -+# elif defined(__GLIBC__)
164 - /* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
165 - /* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
166 - /* prototypes, so we have to include the top-level sigcontext.h to */
167
168 diff --git a/sys-devel/gcc/files/4.9.4/gthread.patch b/sys-devel/gcc/files/4.9.4/gthread.patch
169 deleted file mode 100644
170 index 48aeff1..0000000
171 --- a/sys-devel/gcc/files/4.9.4/gthread.patch
172 +++ /dev/null
173 @@ -1,37 +0,0 @@
174 -diff -Naur gcc-4.9.4.orig/libgfortran/acinclude.m4 gcc-4.9.4/libgfortran/acinclude.m4
175 ---- gcc-4.9.4.orig/libgfortran/acinclude.m4 2016-12-24 16:16:53.481696091 -0800
176 -+++ gcc-4.9.4/libgfortran/acinclude.m4 2016-12-24 16:42:52.045622116 -0800
177 -@@ -100,7 +100,7 @@
178 - [Define to 1 if the target supports #pragma weak])
179 - fi
180 - case "$host" in
181 -- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
182 -+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
183 - AC_DEFINE(GTHREAD_USE_WEAK, 0,
184 - [Define to 0 if the target shouldn't use #pragma weak])
185 - ;;
186 -diff -Naur gcc-4.9.4.orig/libgfortran/configure gcc-4.9.4/libgfortran/configure
187 ---- gcc-4.9.4.orig/libgfortran/configure 2016-12-24 16:16:53.557696818 -0800
188 -+++ gcc-4.9.4/libgfortran/configure 2016-12-24 16:43:06.557762874 -0800
189 -@@ -26355,7 +26355,7 @@
190 -
191 - fi
192 - case "$host" in
193 -- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
194 -+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
195 -
196 - $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
197 -
198 -diff -Naur gcc-4.9.4.orig/libstdc++-v3/config/os/generic/os_defines.h gcc-4.9.4/libstdc++-v3/config/os/generic/os_defines.h
199 ---- gcc-4.9.4.orig/libstdc++-v3/config/os/generic/os_defines.h 2016-12-24 16:16:55.523715643 -0800
200 -+++ gcc-4.9.4/libstdc++-v3/config/os/generic/os_defines.h 2016-12-24 16:44:10.273380874 -0800
201 -@@ -33,4 +33,9 @@
202 - // System-specific #define, typedefs, corrections, etc, go here. This
203 - // file will come before all others.
204 -
205 -+// Disable the weak reference logic in gthr.h for os/generic because it
206 -+// is broken on every platform unless there is implementation specific
207 -+// workaround in gthr-posix.h and at link-time for static linking.
208 -+#define _GLIBCXX_GTHREAD_USE_WEAK 0
209 -+
210 - #endif
211
212 diff --git a/sys-devel/gcc/files/4.9.4/posix_memalign.patch b/sys-devel/gcc/files/4.9.4/posix_memalign.patch
213 deleted file mode 100644
214 index 716aad4..0000000
215 --- a/sys-devel/gcc/files/4.9.4/posix_memalign.patch
216 +++ /dev/null
217 @@ -1,29 +0,0 @@
218 -diff -Naur gcc-4.9.4.orig/gcc/config/i386/pmm_malloc.h gcc-4.9.4/gcc/config/i386/pmm_malloc.h
219 ---- gcc-4.9.4.orig/gcc/config/i386/pmm_malloc.h 2016-12-24 16:17:07.001825547 -0800
220 -+++ gcc-4.9.4/gcc/config/i386/pmm_malloc.h 2016-12-24 16:20:25.242723710 -0800
221 -@@ -27,12 +27,13 @@
222 - #include <stdlib.h>
223 -
224 - /* We can't depend on <stdlib.h> since the prototype of posix_memalign
225 -- may not be visible. */
226 -+ may not be visible and we can't pollute the namespace either. */
227 - #ifndef __cplusplus
228 --extern int posix_memalign (void **, size_t, size_t);
229 -+extern int __gcc_posix_memalign (void **, size_t, size_t)
230 - #else
231 --extern "C" int posix_memalign (void **, size_t, size_t) throw ();
232 -+extern "C" int __gcc_posix_memalign (void **, size_t, size_t) throw ()
233 - #endif
234 -+__asm__("posix_memalign");
235 -
236 - static __inline void *
237 - _mm_malloc (size_t size, size_t alignment)
238 -@@ -42,7 +43,7 @@
239 - return malloc (size);
240 - if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
241 - alignment = sizeof (void *);
242 -- if (posix_memalign (&ptr, alignment, size) == 0)
243 -+ if (__gcc_posix_memalign (&ptr, alignment, size) == 0)
244 - return ptr;
245 - else
246 - return NULL;
247
248 diff --git a/sys-devel/gcc/files/5.4.0/cilkrts.patch b/sys-devel/gcc/files/5.4.0/cilkrts.patch
249 deleted file mode 100644
250 index 8fed5c2..0000000
251 --- a/sys-devel/gcc/files/5.4.0/cilkrts.patch
252 +++ /dev/null
253 @@ -1,46 +0,0 @@
254 -diff -Naur gcc-5.4.0.orig/libcilkrts/runtime/os-unix.c gcc-5.4.0/libcilkrts/runtime/os-unix.c
255 ---- gcc-5.4.0.orig/libcilkrts/runtime/os-unix.c 2014-05-21 04:08:58.000000000 -0700
256 -+++ gcc-5.4.0/libcilkrts/runtime/os-unix.c 2016-12-24 15:35:14.225647627 -0800
257 -@@ -51,6 +51,7 @@
258 - #if defined __linux__
259 - # include <sys/sysinfo.h>
260 - # include <sys/syscall.h>
261 -+# include <sched.h>
262 - #elif defined __APPLE__
263 - # include <sys/sysctl.h>
264 - // Uses sysconf(_SC_NPROCESSORS_ONLN) in verbose output
265 -@@ -400,28 +401,19 @@
266 -
267 - COMMON_SYSDEP void __cilkrts_yield(void)
268 - {
269 --#if __APPLE__ || __FreeBSD__ || __VXWORKS__
270 -- // On MacOS, call sched_yield to yield quantum. I'm not sure why we
271 -- // don't do this on Linux also.
272 -- sched_yield();
273 --#elif defined(__DragonFly__)
274 -- // On DragonFly BSD, call sched_yield to yield quantum.
275 -- sched_yield();
276 --#elif defined(__MIC__)
277 -+#if defined(__MIC__)
278 - // On MIC, pthread_yield() really trashes things. Arch's measurements
279 - // showed that calling _mm_delay_32() (or doing nothing) was a better
280 - // option. Delaying 1024 clock cycles is a reasonable compromise between
281 - // giving up the processor and latency starting up when work becomes
282 - // available
283 - _mm_delay_32(1024);
284 --#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
285 -- // On Android and Solaris, call sched_yield to yield quantum. I'm not
286 -- // sure why we don't do this on Linux also.
287 -- sched_yield();
288 --#else
289 -- // On Linux, call pthread_yield (which in turn will call sched_yield)
290 -- // to yield quantum.
291 -+#elif defined(__sun__) && !defined(__svr4__)
292 -+ // On old SunOS call pthread_yield to yield a quantum.
293 - pthread_yield();
294 -+#else
295 -+ // On other platforms call sched_yield to yield a quantum.
296 -+ sched_yield();
297 - #endif
298 - }
299 -
300
301 diff --git a/sys-devel/gcc/files/5.4.0/linker_path.patch b/sys-devel/gcc/files/5.4.0/linker_path.patch
302 deleted file mode 100644
303 index a2584d4..0000000
304 --- a/sys-devel/gcc/files/5.4.0/linker_path.patch
305 +++ /dev/null
306 @@ -1,213 +0,0 @@
307 -diff -Naur gcc-5.4.0.orig/gcc/config/aarch64/aarch64-linux.h gcc-5.4.0/gcc/config/aarch64/aarch64-linux.h
308 ---- gcc-5.4.0.orig/gcc/config/aarch64/aarch64-linux.h 2015-07-24 09:00:26.000000000 -0700
309 -+++ gcc-5.4.0/gcc/config/aarch64/aarch64-linux.h 2016-12-24 14:48:44.236623207 -0800
310 -@@ -23,6 +23,9 @@
311 -
312 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
313 -
314 -+#undef MUSL_DYNAMIC_LINKER
315 -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
316 -+
317 - #undef ASAN_CC1_SPEC
318 - #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
319 -
320 -diff -Naur gcc-5.4.0.orig/gcc/config/arm/linux-eabi.h gcc-5.4.0/gcc/config/arm/linux-eabi.h
321 ---- gcc-5.4.0.orig/gcc/config/arm/linux-eabi.h 2016-12-24 15:27:49.152307307 -0800
322 -+++ gcc-5.4.0/gcc/config/arm/linux-eabi.h 2016-12-24 14:50:04.522429254 -0800
323 -@@ -77,6 +77,23 @@
324 - %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
325 - %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
326 -
327 -+/* For ARM musl currently supports four dynamic linkers:
328 -+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
329 -+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
330 -+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
331 -+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
332 -+ musl does not support the legacy OABI mode.
333 -+ All the dynamic linkers live in /lib.
334 -+ We default to soft-float, EL. */
335 -+#undef MUSL_DYNAMIC_LINKER
336 -+#if TARGET_BIG_ENDIAN_DEFAULT
337 -+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
338 -+#else
339 -+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
340 -+#endif
341 -+#define MUSL_DYNAMIC_LINKER \
342 -+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
343 -+
344 - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
345 - use the GNU/Linux version, not the generic BPABI version. */
346 - #undef LINK_SPEC
347 -diff -Naur gcc-5.4.0.orig/gcc/config/i386/linux.h gcc-5.4.0/gcc/config/i386/linux.h
348 ---- gcc-5.4.0.orig/gcc/config/i386/linux.h 2015-01-05 04:33:28.000000000 -0800
349 -+++ gcc-5.4.0/gcc/config/i386/linux.h 2016-12-24 14:50:54.802934056 -0800
350 -@@ -21,3 +21,6 @@
351 -
352 - #define GNU_USER_LINK_EMULATION "elf_i386"
353 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
354 -+
355 -+#undef MUSL_DYNAMIC_LINKER
356 -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
357 -diff -Naur gcc-5.4.0.orig/gcc/config/i386/linux64.h gcc-5.4.0/gcc/config/i386/linux64.h
358 ---- gcc-5.4.0.orig/gcc/config/i386/linux64.h 2015-01-05 04:33:28.000000000 -0800
359 -+++ gcc-5.4.0/gcc/config/i386/linux64.h 2016-12-24 14:51:15.579142643 -0800
360 -@@ -30,3 +30,10 @@
361 - #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
362 - #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
363 - #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
364 -+
365 -+#undef MUSL_DYNAMIC_LINKER32
366 -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
367 -+#undef MUSL_DYNAMIC_LINKER64
368 -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
369 -+#undef MUSL_DYNAMIC_LINKERX32
370 -+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
371 -diff -Naur gcc-5.4.0.orig/gcc/config/microblaze/linux.h gcc-5.4.0/gcc/config/microblaze/linux.h
372 ---- gcc-5.4.0.orig/gcc/config/microblaze/linux.h 2015-05-28 07:08:19.000000000 -0700
373 -+++ gcc-5.4.0/gcc/config/microblaze/linux.h 2016-12-24 14:58:26.290647241 -0800
374 -@@ -28,10 +28,20 @@
375 - #undef TLS_NEEDS_GOT
376 - #define TLS_NEEDS_GOT 1
377 -
378 --#define DYNAMIC_LINKER "/lib/ld.so.1"
379 -+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
380 -+
381 -+#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
382 -+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:;:el}"
383 -+#else
384 -+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:el}"
385 -+#endif
386 -+
387 -+#undef MUSL_DYNAMIC_LINKER
388 -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
389 -+
390 - #undef SUBTARGET_EXTRA_SPECS
391 - #define SUBTARGET_EXTRA_SPECS \
392 -- { "dynamic_linker", DYNAMIC_LINKER }
393 -+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
394 -
395 - #undef LINK_SPEC
396 - #define LINK_SPEC "%{shared:-shared} \
397 -diff -Naur gcc-5.4.0.orig/gcc/config/mips/linux.h gcc-5.4.0/gcc/config/mips/linux.h
398 ---- gcc-5.4.0.orig/gcc/config/mips/linux.h 2015-01-05 04:33:28.000000000 -0800
399 -+++ gcc-5.4.0/gcc/config/mips/linux.h 2016-12-24 15:01:34.093670361 -0800
400 -@@ -37,7 +37,13 @@
401 - #define UCLIBC_DYNAMIC_LINKERN32 \
402 - "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
403 -
404 -+#undef MUSL_DYNAMIC_LINKER32
405 -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1"
406 -+#undef MUSL_DYNAMIC_LINKER64
407 -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1"
408 -+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1"
409 -+
410 - #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
411 - #define GNU_USER_DYNAMIC_LINKERN32 \
412 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
413 -- BIONIC_DYNAMIC_LINKERN32)
414 -+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
415 -diff -Naur gcc-5.4.0.orig/gcc/config/rs6000/linux64.h gcc-5.4.0/gcc/config/rs6000/linux64.h
416 ---- gcc-5.4.0.orig/gcc/config/rs6000/linux64.h 2015-03-09 16:18:57.000000000 -0700
417 -+++ gcc-5.4.0/gcc/config/rs6000/linux64.h 2016-12-24 15:03:44.985080397 -0800
418 -@@ -363,19 +367,32 @@
419 - #else
420 - #define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
421 - #endif
422 -+
423 -+#define MUSL_DYNAMIC_LINKER32 \
424 -+ "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
425 -+#define MUSL_DYNAMIC_LINKER64 \
426 -+ "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
427 -+
428 - #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
429 - #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
430 - #if DEFAULT_LIBC == LIBC_UCLIBC
431 --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
432 -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
433 -+ "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
434 - #elif DEFAULT_LIBC == LIBC_GLIBC
435 --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
436 -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
437 -+ "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
438 -+#elif DEFAULT_LIBC == LIBC_MUSL
439 -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
440 -+ "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
441 - #else
442 - #error "Unsupported DEFAULT_LIBC"
443 - #endif
444 - #define GNU_USER_DYNAMIC_LINKER32 \
445 -- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
446 -+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
447 -+ MUSL_DYNAMIC_LINKER32)
448 - #define GNU_USER_DYNAMIC_LINKER64 \
449 -- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
450 -+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
451 -+ MUSL_DYNAMIC_LINKER64)
452 -
453 - #undef DEFAULT_ASM_ENDIAN
454 - #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
455 -diff -Naur gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h gcc-5.4.0/gcc/config/rs6000/sysv4.h
456 ---- gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h 2015-09-24 06:46:45.000000000 -0700
457 -+++ gcc-5.4.0/gcc/config/rs6000/sysv4.h 2016-12-24 15:08:38.507113094 -0800
458 -@@ -757,17 +762,27 @@
459 -
460 - #define LINK_START_LINUX_SPEC ""
461 -
462 -+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","")
463 -+
464 - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
465 - #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
466 -+#define MUSL_DYNAMIC_LINKER \
467 -+ "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
468 - #if DEFAULT_LIBC == LIBC_UCLIBC
469 --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
470 -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
471 -+ "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
472 -+#elif DEFAULT_LIBC == LIBC_MUSL
473 -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
474 -+ "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
475 - #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
476 --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
477 -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) \
478 -+ "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
479 - #else
480 - #error "Unsupported DEFAULT_LIBC"
481 - #endif
482 - #define GNU_USER_DYNAMIC_LINKER \
483 -- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
484 -+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
485 -+ MUSL_DYNAMIC_LINKER)
486 -
487 - #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
488 - %{rdynamic:-export-dynamic} \
489 -diff -Naur gcc-5.4.0.orig/gcc/config/sh/linux.h gcc-5.4.0/gcc/config/sh/linux.h
490 ---- gcc-5.4.0.orig/gcc/config/sh/linux.h 2015-01-05 04:33:28.000000000 -0800
491 -+++ gcc-5.4.0/gcc/config/sh/linux.h 2016-12-24 15:09:54.568853072 -0800
492 -@@ -43,6 +43,27 @@
493 -
494 - #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
495 -
496 -+#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
497 -+#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}"
498 -+#else
499 -+#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}"
500 -+#endif
501 -+
502 -+#if TARGET_CPU_DEFAULT & (MASK_HARD_SH2A_DOUBLE | MASK_SH4)
503 -+/* "-nofpu" if any nofpu option is specified. */
504 -+#define MUSL_DYNAMIC_LINKER_FP \
505 -+ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \
506 -+ "m4-340|m4-400|m4-500|m4al:-nofpu}"
507 -+#else
508 -+/* "-nofpu" if none of the hard fpu options are specified. */
509 -+#define MUSL_DYNAMIC_LINKER_FP "%{m2a|m4|m4-100|m4-200|m4-300|m4a:;:-nofpu}"
510 -+#endif
511 -+
512 -+#undef MUSL_DYNAMIC_LINKER
513 -+#define MUSL_DYNAMIC_LINKER \
514 -+ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP \
515 -+ "%{mfdpic:-fdpic}.so.1"
516 -+
517 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
518 -
519 - #undef SUBTARGET_LINK_EMUL_SUFFIX
520
521 diff --git a/sys-devel/gcc/files/5.4.0/musl.patch b/sys-devel/gcc/files/5.4.0/musl.patch
522 deleted file mode 100644
523 index c1541b2..0000000
524 --- a/sys-devel/gcc/files/5.4.0/musl.patch
525 +++ /dev/null
526 @@ -1,502 +0,0 @@
527 -diff -Naur gcc-5.4.0.orig/fixincludes/mkfixinc.sh gcc-5.4.0/fixincludes/mkfixinc.sh
528 ---- gcc-5.4.0.orig/fixincludes/mkfixinc.sh 2012-10-28 14:42:48.000000000 -0700
529 -+++ gcc-5.4.0/fixincludes/mkfixinc.sh 2016-12-24 14:47:04.324620119 -0800
530 -@@ -19,7 +19,8 @@
531 - powerpc-*-eabi* | \
532 - powerpc-*-rtems* | \
533 - powerpcle-*-eabisim* | \
534 -- powerpcle-*-eabi* )
535 -+ powerpcle-*-eabi* | \
536 -+ *-musl* )
537 - # IF there is no include fixing,
538 - # THEN create a no-op fixer and exit
539 - (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
540 -diff -Naur gcc-5.4.0.orig/gcc/config/glibc-stdint.h gcc-5.4.0/gcc/config/glibc-stdint.h
541 ---- gcc-5.4.0.orig/gcc/config/glibc-stdint.h 2015-01-05 04:33:28.000000000 -0800
542 -+++ gcc-5.4.0/gcc/config/glibc-stdint.h 2016-12-24 15:24:46.234527766 -0800
543 -@@ -22,6 +22,12 @@
544 - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
545 - <http://www.gnu.org/licenses/>. */
546 -
547 -+/* Systems using musl libc should use this header and make sure
548 -+ OPTION_MUSL is defined correctly before using the TYPE macros. */
549 -+#ifndef OPTION_MUSL
550 -+#define OPTION_MUSL 0
551 -+#endif
552 -+
553 - #define SIG_ATOMIC_TYPE "int"
554 -
555 - #define INT8_TYPE "signed char"
556 -@@ -43,12 +49,12 @@
557 - #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
558 -
559 - #define INT_FAST8_TYPE "signed char"
560 --#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
561 --#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
562 -+#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
563 -+#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
564 - #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
565 - #define UINT_FAST8_TYPE "unsigned char"
566 --#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
567 --#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
568 -+#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
569 -+#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
570 - #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
571 -
572 - #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
573 -diff -Naur gcc-5.4.0.orig/gcc/config/linux.c gcc-5.4.0/gcc/config/linux.c
574 ---- gcc-5.4.0.orig/gcc/config/linux.c 2015-01-05 04:33:28.000000000 -0800
575 -+++ gcc-5.4.0/gcc/config/linux.c 2016-12-24 15:35:58.913083568 -0800
576 -@@ -26,7 +26,7 @@
577 - bool
578 - linux_libc_has_function (enum function_class fn_class)
579 - {
580 -- if (OPTION_GLIBC)
581 -+ if (OPTION_GLIBC || OPTION_MUSL)
582 - return true;
583 - if (OPTION_BIONIC)
584 - if (fn_class == function_c94
585 -diff -Naur gcc-5.4.0.orig/gcc/config/linux.h gcc-5.4.0/gcc/config/linux.h
586 ---- gcc-5.4.0.orig/gcc/config/linux.h 2015-01-05 04:33:28.000000000 -0800
587 -+++ gcc-5.4.0/gcc/config/linux.h 2016-12-24 14:55:26.718712791 -0800
588 -@@ -32,10 +32,14 @@
589 - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
590 - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
591 - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
592 -+#undef OPTION_MUSL
593 -+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
594 - #else
595 - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
596 - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
597 - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
598 -+#undef OPTION_MUSL
599 -+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
600 - #endif
601 -
602 - #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
603 -@@ -50,21 +54,25 @@
604 - } while (0)
605 -
606 - /* Determine which dynamic linker to use depending on whether GLIBC or
607 -- uClibc or Bionic is the default C library and whether
608 -- -muclibc or -mglibc or -mbionic has been passed to change the default. */
609 -+ uClibc or Bionic or musl is the default C library and whether
610 -+ -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
611 -+ the default. */
612 -
613 --#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
614 -- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
615 -+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
616 -+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
617 -
618 - #if DEFAULT_LIBC == LIBC_GLIBC
619 --#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
620 -- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
621 -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
622 -+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
623 - #elif DEFAULT_LIBC == LIBC_UCLIBC
624 --#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
625 -- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
626 -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
627 -+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
628 - #elif DEFAULT_LIBC == LIBC_BIONIC
629 --#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
630 -- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
631 -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
632 -+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
633 -+#elif DEFAULT_LIBC == LIBC_MUSL
634 -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
635 -+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
636 - #else
637 - #error "Unsupported DEFAULT_LIBC"
638 - #endif /* DEFAULT_LIBC */
639 -@@ -81,24 +89,101 @@
640 - #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
641 - #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
642 - #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
643 -+/* Should be redefined for each target that supports musl. */
644 -+#define MUSL_DYNAMIC_LINKER "/dev/null"
645 -+#define MUSL_DYNAMIC_LINKER32 "/dev/null"
646 -+#define MUSL_DYNAMIC_LINKER64 "/dev/null"
647 -+#define MUSL_DYNAMIC_LINKERX32 "/dev/null"
648 -
649 - #define GNU_USER_DYNAMIC_LINKER \
650 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
651 -- BIONIC_DYNAMIC_LINKER)
652 -+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
653 - #define GNU_USER_DYNAMIC_LINKER32 \
654 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
655 -- BIONIC_DYNAMIC_LINKER32)
656 -+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
657 - #define GNU_USER_DYNAMIC_LINKER64 \
658 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
659 -- BIONIC_DYNAMIC_LINKER64)
660 -+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
661 - #define GNU_USER_DYNAMIC_LINKERX32 \
662 - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
663 -- BIONIC_DYNAMIC_LINKERX32)
664 -+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
665 -
666 - /* Whether we have Bionic libc runtime */
667 - #undef TARGET_HAS_BIONIC
668 - #define TARGET_HAS_BIONIC (OPTION_BIONIC)
669 -
670 -+/* musl avoids problematic includes by rearranging the include directories.
671 -+ * Unfortunately, this is mostly duplicated from cppdefault.c */
672 -+#if DEFAULT_LIBC == LIBC_MUSL
673 -+#define INCLUDE_DEFAULTS_MUSL_GPP \
674 -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
675 -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
676 -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
677 -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
678 -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
679 -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
680 -+
681 -+#ifdef LOCAL_INCLUDE_DIR
682 -+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
683 -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
684 -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
685 -+#else
686 -+#define INCLUDE_DEFAULTS_MUSL_LOCAL
687 -+#endif
688 -+
689 -+#ifdef PREFIX_INCLUDE_DIR
690 -+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
691 -+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
692 -+#else
693 -+#define INCLUDE_DEFAULTS_MUSL_PREFIX
694 -+#endif
695 -+
696 -+#ifdef CROSS_INCLUDE_DIR
697 -+#define INCLUDE_DEFAULTS_MUSL_CROSS \
698 -+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
699 -+#else
700 -+#define INCLUDE_DEFAULTS_MUSL_CROSS
701 -+#endif
702 -+
703 -+#ifdef TOOL_INCLUDE_DIR
704 -+#define INCLUDE_DEFAULTS_MUSL_TOOL \
705 -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
706 -+#else
707 -+#define INCLUDE_DEFAULTS_MUSL_TOOL
708 -+#endif
709 -+
710 -+#ifdef NATIVE_SYSTEM_HEADER_DIR
711 -+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
712 -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
713 -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
714 -+#else
715 -+#define INCLUDE_DEFAULTS_MUSL_NATIVE
716 -+#endif
717 -+
718 -+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
719 -+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
720 -+# define INCLUDE_DEFAULTS_MUSL_LOCAL
721 -+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
722 -+# define INCLUDE_DEFAULTS_MUSL_NATIVE
723 -+#else
724 -+# undef INCLUDE_DEFAULTS_MUSL_CROSS
725 -+# define INCLUDE_DEFAULTS_MUSL_CROSS
726 -+#endif
727 -+
728 -+#undef INCLUDE_DEFAULTS
729 -+#define INCLUDE_DEFAULTS \
730 -+ { \
731 -+ INCLUDE_DEFAULTS_MUSL_GPP \
732 -+ INCLUDE_DEFAULTS_MUSL_LOCAL \
733 -+ INCLUDE_DEFAULTS_MUSL_PREFIX \
734 -+ INCLUDE_DEFAULTS_MUSL_CROSS \
735 -+ INCLUDE_DEFAULTS_MUSL_TOOL \
736 -+ INCLUDE_DEFAULTS_MUSL_NATIVE \
737 -+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
738 -+ { 0, 0, 0, 0, 0, 0 } \
739 -+ }
740 -+#endif
741 -+
742 - #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
743 - /* This is a *uclinux* target. We don't define below macros to normal linux
744 - versions, because doing so would require *uclinux* targets to include
745 -diff -Naur gcc-5.4.0.orig/gcc/config/linux.opt gcc-5.4.0/gcc/config/linux.opt
746 ---- gcc-5.4.0.orig/gcc/config/linux.opt 2015-01-05 04:33:28.000000000 -0800
747 -+++ gcc-5.4.0/gcc/config/linux.opt 2016-12-24 14:56:23.784327534 -0800
748 -@@ -28,5 +28,9 @@
749 - Use GNU C library
750 -
751 - muclibc
752 --Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
753 -+Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl)
754 - Use uClibc C library
755 -+
756 -+mmusl
757 -+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic)
758 -+Use musl C library.
759 -diff -Naur gcc-5.4.0.orig/gcc/config/rs6000/linux64.h gcc-5.4.0/gcc/config/rs6000/linux64.h
760 ---- gcc-5.4.0.orig/gcc/config/rs6000/linux64.h 2015-03-09 16:18:57.000000000 -0700
761 -+++ gcc-5.4.0/gcc/config/rs6000/linux64.h 2016-12-24 15:03:44.985080397 -0800
762 -@@ -299,10 +299,14 @@
763 - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
764 - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
765 - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
766 -+#undef OPTION_MUSL
767 -+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
768 - #else
769 - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
770 - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
771 - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
772 -+#undef OPTION_MUSL
773 -+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
774 - #endif
775 -
776 - /* Determine what functions are present at the runtime;
777 -diff -Naur gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h gcc-5.4.0/gcc/config/rs6000/sysv4.h
778 ---- gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h 2015-09-24 06:46:45.000000000 -0700
779 -+++ gcc-5.4.0/gcc/config/rs6000/sysv4.h 2016-12-24 15:08:38.507113094 -0800
780 -@@ -943,3 +959,73 @@
781 - /* This target uses the sysv4.opt file. */
782 - #define TARGET_USES_SYSV4_OPT 1
783 -
784 -+/* Include order changes for musl, same as in generic linux.h. */
785 -+#if DEFAULT_LIBC == LIBC_MUSL
786 -+#define INCLUDE_DEFAULTS_MUSL_GPP \
787 -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
788 -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
789 -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
790 -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
791 -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
792 -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
793 -+
794 -+#ifdef LOCAL_INCLUDE_DIR
795 -+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
796 -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
797 -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
798 -+#else
799 -+#define INCLUDE_DEFAULTS_MUSL_LOCAL
800 -+#endif
801 -+
802 -+#ifdef PREFIX_INCLUDE_DIR
803 -+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
804 -+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
805 -+#else
806 -+#define INCLUDE_DEFAULTS_MUSL_PREFIX
807 -+#endif
808 -+
809 -+#ifdef CROSS_INCLUDE_DIR
810 -+#define INCLUDE_DEFAULTS_MUSL_CROSS \
811 -+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
812 -+#else
813 -+#define INCLUDE_DEFAULTS_MUSL_CROSS
814 -+#endif
815 -+
816 -+#ifdef TOOL_INCLUDE_DIR
817 -+#define INCLUDE_DEFAULTS_MUSL_TOOL \
818 -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
819 -+#else
820 -+#define INCLUDE_DEFAULTS_MUSL_TOOL
821 -+#endif
822 -+
823 -+#ifdef NATIVE_SYSTEM_HEADER_DIR
824 -+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
825 -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
826 -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
827 -+#else
828 -+#define INCLUDE_DEFAULTS_MUSL_NATIVE
829 -+#endif
830 -+
831 -+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
832 -+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
833 -+# define INCLUDE_DEFAULTS_MUSL_LOCAL
834 -+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
835 -+# define INCLUDE_DEFAULTS_MUSL_NATIVE
836 -+#else
837 -+# undef INCLUDE_DEFAULTS_MUSL_CROSS
838 -+# define INCLUDE_DEFAULTS_MUSL_CROSS
839 -+#endif
840 -+
841 -+#undef INCLUDE_DEFAULTS
842 -+#define INCLUDE_DEFAULTS \
843 -+ { \
844 -+ INCLUDE_DEFAULTS_MUSL_GPP \
845 -+ INCLUDE_DEFAULTS_MUSL_LOCAL \
846 -+ INCLUDE_DEFAULTS_MUSL_PREFIX \
847 -+ INCLUDE_DEFAULTS_MUSL_CROSS \
848 -+ INCLUDE_DEFAULTS_MUSL_TOOL \
849 -+ INCLUDE_DEFAULTS_MUSL_NATIVE \
850 -+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
851 -+ { 0, 0, 0, 0, 0, 0 } \
852 -+ }
853 -+#endif
854 -diff -Naur gcc-5.4.0.orig/gcc/config.gcc gcc-5.4.0/gcc/config.gcc
855 ---- gcc-5.4.0.orig/gcc/config.gcc 2016-12-24 15:28:09.922509373 -0800
856 -+++ gcc-5.4.0/gcc/config.gcc 2016-12-24 15:39:19.482040184 -0800
857 -@@ -575,7 +575,7 @@
858 - esac
859 -
860 - # Common C libraries.
861 --tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
862 -+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
863 -
864 - # 32-bit x86 processors supported by --with-arch=. Each processor
865 - # MUST be separated by exactly one space.
866 -@@ -720,6 +720,9 @@
867 - *-*-*uclibc*)
868 - tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
869 - ;;
870 -+ *-*-*musl*)
871 -+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
872 -+ ;;
873 - *)
874 - tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
875 - ;;
876 -@@ -1438,7 +1441,7 @@
877 - extra_options="${extra_options} linux-android.opt"
878 - # Assume modern glibc if not targeting Android nor uclibc.
879 - case ${target} in
880 -- *-*-*android*|*-*-*uclibc*)
881 -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*)
882 - ;;
883 - *)
884 - default_gnu_indirect_function=yes
885 -@@ -1507,7 +1510,7 @@
886 - extra_options="${extra_options} linux-android.opt"
887 - # Assume modern glibc if not targeting Android nor uclibc.
888 - case ${target} in
889 -- *-*-*android*|*-*-*uclibc*)
890 -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*)
891 - ;;
892 - *)
893 - default_gnu_indirect_function=yes
894 -diff -Naur gcc-5.4.0.orig/gcc/configure gcc-5.4.0/gcc/configure
895 ---- gcc-5.4.0.orig/gcc/configure 2016-12-24 15:28:54.117939552 -0800
896 -+++ gcc-5.4.0/gcc/configure 2016-12-24 15:13:46.057105137 -0800
897 -@@ -27837,6 +27837,9 @@
898 - else
899 - gcc_cv_libc_provides_ssp=no
900 - case "$target" in
901 -+ *-*-musl*)
902 -+ # All versions of musl provide stack protector
903 -+ gcc_cv_libc_provides_ssp=yes;;
904 - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
905 - # glibc 2.4 and later provides __stack_chk_fail and
906 - # either __stack_chk_guard, or TLS access to stack guard canary.
907 -@@ -27869,6 +27872,7 @@
908 - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
909 - # simply assert that glibc does provide this, which is true for all
910 - # realistically usable GNU/Hurd configurations.
911 -+ # All supported versions of musl provide it as well
912 - gcc_cv_libc_provides_ssp=yes;;
913 - *-*-darwin* | *-*-freebsd*)
914 - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
915 -@@ -27965,6 +27969,9 @@
916 - gcc_cv_target_dl_iterate_phdr=no
917 - fi
918 - ;;
919 -+ *-linux-musl*)
920 -+ gcc_cv_target_dl_iterate_phdr=yes
921 -+ ;;
922 - esac
923 -
924 - if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
925 -diff -Naur gcc-5.4.0.orig/gcc/configure.ac gcc-5.4.0/gcc/configure.ac
926 ---- gcc-5.4.0.orig/gcc/configure.ac 2016-12-24 15:28:32.129725419 -0800
927 -+++ gcc-5.4.0/gcc/configure.ac 2016-12-24 15:14:52.372750299 -0800
928 -@@ -5287,6 +5287,9 @@
929 - gcc_cv_libc_provides_ssp,
930 - [gcc_cv_libc_provides_ssp=no
931 - case "$target" in
932 -+ *-*-musl*)
933 -+ # All versions of musl provide stack protector
934 -+ gcc_cv_libc_provides_ssp=yes;;
935 - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
936 - # glibc 2.4 and later provides __stack_chk_fail and
937 - # either __stack_chk_guard, or TLS access to stack guard canary.
938 -@@ -5313,6 +5316,7 @@
939 - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
940 - # simply assert that glibc does provide this, which is true for all
941 - # realistically usable GNU/Hurd configurations.
942 -+ # All supported versions of musl provide it as well
943 - gcc_cv_libc_provides_ssp=yes;;
944 - *-*-darwin* | *-*-freebsd*)
945 - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
946 -@@ -5386,6 +5390,9 @@
947 - gcc_cv_target_dl_iterate_phdr=no
948 - fi
949 - ;;
950 -+ *-linux-musl*)
951 -+ gcc_cv_target_dl_iterate_phdr=yes
952 -+ ;;
953 - esac
954 - GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
955 - if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
956 -diff -Naur gcc-5.4.0.orig/libgcc/unwind-dw2-fde-dip.c gcc-5.4.0/libgcc/unwind-dw2-fde-dip.c
957 ---- gcc-5.4.0.orig/libgcc/unwind-dw2-fde-dip.c 2015-01-27 02:02:26.000000000 -0800
958 -+++ gcc-5.4.0/libgcc/unwind-dw2-fde-dip.c 2016-12-24 15:16:56.850961302 -0800
959 -@@ -59,6 +59,12 @@
960 -
961 - #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
962 - && defined(TARGET_DL_ITERATE_PHDR) \
963 -+ && defined(__linux__)
964 -+# define USE_PT_GNU_EH_FRAME
965 -+#endif
966 -+
967 -+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
968 -+ && defined(TARGET_DL_ITERATE_PHDR) \
969 - && (defined(__DragonFly__) || defined(__FreeBSD__))
970 - # define ElfW __ElfN
971 - # define USE_PT_GNU_EH_FRAME
972 -diff -Naur gcc-5.4.0.orig/libitm/config/arm/hwcap.cc gcc-5.4.0/libitm/config/arm/hwcap.cc
973 ---- gcc-5.4.0.orig/libitm/config/arm/hwcap.cc 2015-01-05 04:33:28.000000000 -0800
974 -+++ gcc-5.4.0/libitm/config/arm/hwcap.cc 2016-12-24 15:19:01.076169845 -0800
975 -@@ -40,7 +40,7 @@
976 -
977 - #ifdef __linux__
978 - #include <unistd.h>
979 --#include <sys/fcntl.h>
980 -+#include <fcntl.h>
981 - #include <elf.h>
982 -
983 - static void __attribute__((constructor))
984 -diff -Naur gcc-5.4.0.orig/libitm/config/linux/x86/tls.h gcc-5.4.0/libitm/config/linux/x86/tls.h
985 ---- gcc-5.4.0.orig/libitm/config/linux/x86/tls.h 2015-01-05 04:33:28.000000000 -0800
986 -+++ gcc-5.4.0/libitm/config/linux/x86/tls.h 2016-12-24 15:20:21.897956131 -0800
987 -@@ -25,16 +25,19 @@
988 - #ifndef LIBITM_X86_TLS_H
989 - #define LIBITM_X86_TLS_H 1
990 -
991 --#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
992 -+#if defined(__GLIBC_PREREQ)
993 -+#if __GLIBC_PREREQ(2, 10)
994 - /* Use slots in the TCB head rather than __thread lookups.
995 - GLIBC has reserved words 10 through 13 for TM. */
996 - #define HAVE_ARCH_GTM_THREAD 1
997 - #define HAVE_ARCH_GTM_THREAD_DISP 1
998 - #endif
999 -+#endif
1000 -
1001 - #include "config/generic/tls.h"
1002 -
1003 --#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
1004 -+#if defined(__GLIBC_PREREQ)
1005 -+#if __GLIBC_PREREQ(2, 10)
1006 - namespace GTM HIDDEN {
1007 -
1008 - #ifdef __x86_64__
1009 -@@ -101,5 +104,6 @@
1010 -
1011 - } // namespace GTM
1012 - #endif /* >= GLIBC 2.10 */
1013 -+#endif
1014 -
1015 - #endif // LIBITM_X86_TLS_H
1016 -diff -Naur gcc-5.4.0.orig/libstdc++-v3/configure.host gcc-5.4.0/libstdc++-v3/configure.host
1017 ---- gcc-5.4.0.orig/libstdc++-v3/configure.host 2015-06-24 02:59:28.000000000 -0700
1018 -+++ gcc-5.4.0/libstdc++-v3/configure.host 2016-12-24 15:21:16.012482591 -0800
1019 -@@ -273,6 +273,9 @@
1020 - freebsd*)
1021 - os_include_dir="os/bsd/freebsd"
1022 - ;;
1023 -+ linux-musl*)
1024 -+ os_include_dir="os/generic"
1025 -+ ;;
1026 - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
1027 - if [ "$uclibc" = "yes" ]; then
1028 - os_include_dir="os/uclibc"
1029
1030 diff --git a/sys-devel/gcc/files/5.4.0/ppc-secure_plt.patch b/sys-devel/gcc/files/5.4.0/ppc-secure_plt.patch
1031 deleted file mode 100644
1032 index 4e7f9d4..0000000
1033 --- a/sys-devel/gcc/files/5.4.0/ppc-secure_plt.patch
1034 +++ /dev/null
1035 @@ -1,59 +0,0 @@
1036 -diff -Naur gcc-5.4.0.orig/gcc/config/rs6000/secureplt.h gcc-5.4.0/gcc/config/rs6000/secureplt.h
1037 ---- gcc-5.4.0.orig/gcc/config/rs6000/secureplt.h 2015-01-05 04:33:28.000000000 -0800
1038 -+++ gcc-5.4.0/gcc/config/rs6000/secureplt.h 2016-12-24 15:04:26.850531396 -0800
1039 -@@ -18,3 +18,4 @@
1040 - <http://www.gnu.org/licenses/>. */
1041 -
1042 - #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
1043 -+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
1044 -diff -Naur gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h gcc-5.4.0/gcc/config/rs6000/sysv4.h
1045 ---- gcc-5.4.0.orig/gcc/config/rs6000/sysv4.h 2015-09-24 06:46:45.000000000 -0700
1046 -+++ gcc-5.4.0/gcc/config/rs6000/sysv4.h 2016-12-24 15:08:38.507113094 -0800
1047 -@@ -537,6 +537,9 @@
1048 - #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
1049 - #define CC1_SECURE_PLT_DEFAULT_SPEC ""
1050 - #endif
1051 -+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
1052 -+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
1053 -+#endif
1054 -
1055 - /* Pass -G xxx to the compiler. */
1056 - #undef CC1_SPEC
1057 -@@ -567,6 +570,7 @@
1058 - : %(link_start_default) }"
1059 -
1060 - #define LINK_START_DEFAULT_SPEC ""
1061 -+#define LINK_SECURE_PLT_SPEC LINK_SECURE_PLT_DEFAULT_SPEC
1062 -
1063 - #undef LINK_SPEC
1064 - #define LINK_SPEC "\
1065 -@@ -574,6 +578,7 @@
1066 - %{R*} \
1067 - %(link_shlib) \
1068 - %{!T*: %(link_start) } \
1069 -+%{!static: %{!mbss-plt: %(link_secure_plt)}} \
1070 - %(link_os)"
1071 -
1072 - /* Shared libraries are not default. */
1073 -@@ -889,6 +904,7 @@
1074 - { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
1075 - { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
1076 - { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
1077 -+ { "link_secure_plt", LINK_SECURE_PLT_SPEC }, \
1078 - { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
1079 - { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
1080 - { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
1081 -diff -Naur gcc-5.4.0.orig/gcc/config.gcc gcc-5.4.0/gcc/config.gcc
1082 ---- gcc-5.4.0.orig/gcc/config.gcc 2016-12-24 15:28:09.922509373 -0800
1083 -+++ gcc-5.4.0/gcc/config.gcc 2016-12-24 15:39:19.482040184 -0800
1084 -@@ -2413,6 +2416,10 @@
1085 - powerpc*-*-linux*paired*)
1086 - tm_file="${tm_file} rs6000/750cl.h" ;;
1087 - esac
1088 -+ case ${target} in
1089 -+ *-linux*-musl*)
1090 -+ enable_secureplt=yes ;;
1091 -+ esac
1092 - if test x${enable_secureplt} = xyes; then
1093 - tm_file="rs6000/secureplt.h ${tm_file}"
1094 - fi
1095
1096 diff --git a/sys-devel/gcc/files/6.3.0/musl.patch b/sys-devel/gcc/files/6.3.0/musl.patch
1097 deleted file mode 100644
1098 index 2d56a5c..0000000
1099 --- a/sys-devel/gcc/files/6.3.0/musl.patch
1100 +++ /dev/null
1101 @@ -1,33 +0,0 @@
1102 -diff -Naur gcc-6.2.0.orig/gcc/config/linux.c gcc-6.2.0/gcc/config/linux.c
1103 ---- gcc-6.2.0.orig/gcc/config/linux.c 2016-12-24 15:55:23.308342638 -0800
1104 -+++ gcc-6.2.0/gcc/config/linux.c 2016-12-24 16:00:51.852488459 -0800
1105 -@@ -26,7 +26,7 @@
1106 - bool
1107 - linux_libc_has_function (enum function_class fn_class)
1108 - {
1109 -- if (OPTION_GLIBC)
1110 -+ if (OPTION_GLIBC || OPTION_MUSL)
1111 - return true;
1112 - if (OPTION_BIONIC)
1113 - if (fn_class == function_c94
1114 -diff -Naur gcc-6.2.0.orig/gcc/config.gcc gcc-6.2.0/gcc/config.gcc
1115 ---- gcc-6.2.0.orig/gcc/config.gcc 2016-12-24 15:55:15.957272251 -0800
1116 -+++ gcc-6.2.0/gcc/config.gcc 2016-12-24 16:02:12.297258721 -0800
1117 -@@ -1484,7 +1484,7 @@
1118 - extra_options="${extra_options} linux-android.opt"
1119 - # Assume modern glibc if not targeting Android nor uclibc.
1120 - case ${target} in
1121 -- *-*-*android*|*-*-*uclibc*)
1122 -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*)
1123 - ;;
1124 - *)
1125 - default_gnu_indirect_function=yes
1126 -@@ -1553,7 +1553,7 @@
1127 - extra_options="${extra_options} linux-android.opt"
1128 - # Assume modern glibc if not targeting Android nor uclibc.
1129 - case ${target} in
1130 -- *-*-*android*|*-*-*uclibc*)
1131 -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*)
1132 - ;;
1133 - *)
1134 - default_gnu_indirect_function=yes
1135
1136 diff --git a/sys-devel/gcc/files/gcc-4.9.3-tree-vect-data-refs-correctness.patch b/sys-devel/gcc/files/gcc-4.9.3-tree-vect-data-refs-correctness.patch
1137 deleted file mode 100644
1138 index d865e25..0000000
1139 --- a/sys-devel/gcc/files/gcc-4.9.3-tree-vect-data-refs-correctness.patch
1140 +++ /dev/null
1141 @@ -1,11 +0,0 @@
1142 ---- trunk/gcc/tree-vect-data-refs.c 2015/11/20 16:15:57 230666
1143 -+++ trunk/gcc/tree-vect-data-refs.c 2015/11/20 16:27:17
1144 -@@ -2545,6 +2545,8 @@
1145 - if (t2 == NULL)
1146 - return 1;
1147 -
1148 -+ STRIP_NOPS (t1);
1149 -+ STRIP_NOPS (t2);
1150 -
1151 - if (TREE_CODE (t1) != TREE_CODE (t2))
1152 - return TREE_CODE (t1) < TREE_CODE (t2) ? -1 : 1;
1153
1154 diff --git a/sys-devel/gcc/files/gcc-5.4.0-pr68470.patch b/sys-devel/gcc/files/gcc-5.4.0-pr68470.patch
1155 deleted file mode 100644
1156 index 7f314cf..0000000
1157 --- a/sys-devel/gcc/files/gcc-5.4.0-pr68470.patch
1158 +++ /dev/null
1159 @@ -1,57 +0,0 @@
1160 -diff -Naur gcc-5.4.0.orig/gcc/ipa-split.c gcc-5.4.0/gcc/ipa-split.c
1161 ---- gcc-5.4.0.orig/gcc/ipa-split.c 2016-03-30 05:27:12.000000000 -0700
1162 -+++ gcc-5.4.0/gcc/ipa-split.c 2016-12-24 17:10:50.205152721 -0800
1163 -@@ -1246,7 +1246,6 @@
1164 - edge e;
1165 - edge_iterator ei;
1166 - tree retval = NULL, real_retval = NULL, retbnd = NULL;
1167 -- bool split_part_return_p = false;
1168 - bool with_bounds = chkp_function_instrumented_p (current_function_decl);
1169 - gimple last_stmt = NULL;
1170 - unsigned int i;
1171 -@@ -1287,12 +1286,28 @@
1172 - args_to_pass.safe_push (arg);
1173 - }
1174 -
1175 -- /* See if the split function will return. */
1176 -+ /* See if the split function or the main part will return. */
1177 -+ bool main_part_return_p = false;
1178 -+ bool split_part_return_p = false;
1179 - FOR_EACH_EDGE (e, ei, return_bb->preds)
1180 -- if (bitmap_bit_p (split_point->split_bbs, e->src->index))
1181 -- break;
1182 -- if (e)
1183 -- split_part_return_p = true;
1184 -+ {
1185 -+ if (bitmap_bit_p (split_point->split_bbs, e->src->index))
1186 -+ split_part_return_p = true;
1187 -+ else
1188 -+ main_part_return_p = true;
1189 -+ }
1190 -+ /* The main part also returns if we we split on a fallthru edge
1191 -+ and the split part returns. */
1192 -+ if (split_part_return_p)
1193 -+ FOR_EACH_EDGE (e, ei, split_point->entry_bb->preds)
1194 -+ {
1195 -+ if (! bitmap_bit_p (split_point->split_bbs, e->src->index)
1196 -+ && single_succ_p (e->src))
1197 -+ {
1198 -+ main_part_return_p = true;
1199 -+ break;
1200 -+ }
1201 -+ }
1202 -
1203 - /* Add return block to what will become the split function.
1204 - We do not return; no return block is needed. */
1205 -@@ -1336,6 +1351,11 @@
1206 - else
1207 - bitmap_set_bit (split_point->split_bbs, return_bb->index);
1208 -
1209 -+ /* If the main part doesn't return pretend the return block wasn't
1210 -+ found for all of the following. */
1211 -+ if (! main_part_return_p)
1212 -+ return_bb = EXIT_BLOCK_PTR_FOR_FN (cfun);
1213 -+
1214 - /* If RETURN_BB has virtual operand PHIs, they must be removed and the
1215 - virtual operand marked for renaming as we change the CFG in a way that
1216 - tree-inline is not able to compensate for.
1217
1218 diff --git a/sys-devel/gcc/files/gcc-5.4.0-pr70473.patch b/sys-devel/gcc/files/gcc-5.4.0-pr70473.patch
1219 deleted file mode 100644
1220 index 798a457..0000000
1221 --- a/sys-devel/gcc/files/gcc-5.4.0-pr70473.patch
1222 +++ /dev/null
1223 @@ -1,43 +0,0 @@
1224 ---- a/gcc/config/arm/cortex-a8-neon.md 2016/08/26 10:22:08 239771
1225 -+++ b/gcc/config/arm/cortex-a8-neon.md 2016/08/26 10:23:20 239772
1226 -@@ -357,30 +357,34 @@
1227 - (eq_attr "type" "fmuls"))
1228 - "cortex_a8_vfp,cortex_a8_vfplite*11")
1229 -
1230 -+;; Don't model a reservation for more than 15 cycles as this explodes the
1231 -+;; state space of the automaton for little gain. It is unlikely that the
1232 -+;; scheduler will find enough instructions to hide the full latency of the
1233 -+;; instructions.
1234 - (define_insn_reservation "cortex_a8_vfp_muld" 17
1235 - (and (eq_attr "tune" "cortexa8")
1236 - (eq_attr "type" "fmuld"))
1237 -- "cortex_a8_vfp,cortex_a8_vfplite*16")
1238 -+ "cortex_a8_vfp,cortex_a8_vfplite*15")
1239 -
1240 - (define_insn_reservation "cortex_a8_vfp_macs" 21
1241 - (and (eq_attr "tune" "cortexa8")
1242 - (eq_attr "type" "fmacs,ffmas"))
1243 -- "cortex_a8_vfp,cortex_a8_vfplite*20")
1244 -+ "cortex_a8_vfp,cortex_a8_vfplite*15")
1245 -
1246 - (define_insn_reservation "cortex_a8_vfp_macd" 26
1247 - (and (eq_attr "tune" "cortexa8")
1248 - (eq_attr "type" "fmacd,ffmad"))
1249 -- "cortex_a8_vfp,cortex_a8_vfplite*25")
1250 -+ "cortex_a8_vfp,cortex_a8_vfplite*15")
1251 -
1252 - (define_insn_reservation "cortex_a8_vfp_divs" 37
1253 - (and (eq_attr "tune" "cortexa8")
1254 - (eq_attr "type" "fdivs, fsqrts"))
1255 -- "cortex_a8_vfp,cortex_a8_vfplite*36")
1256 -+ "cortex_a8_vfp,cortex_a8_vfplite*15")
1257 -
1258 - (define_insn_reservation "cortex_a8_vfp_divd" 65
1259 - (and (eq_attr "tune" "cortexa8")
1260 - (eq_attr "type" "fdivd, fsqrtd"))
1261 -- "cortex_a8_vfp,cortex_a8_vfplite*64")
1262 -+ "cortex_a8_vfp,cortex_a8_vfplite*15")
1263 -
1264 - ;; Comparisons can actually take 7 cycles sometimes instead of four,
1265 - ;; but given all the other instructions lumped into type=ffarith that
1266 -
1267
1268 diff --git a/sys-devel/gcc/files/gcc-5.4.0-pr71696-CVE-2016-6131.patch b/sys-devel/gcc/files/gcc-5.4.0-pr71696-CVE-2016-6131.patch
1269 deleted file mode 100644
1270 index b16edbb..0000000
1271 --- a/sys-devel/gcc/files/gcc-5.4.0-pr71696-CVE-2016-6131.patch
1272 +++ /dev/null
1273 @@ -1,252 +0,0 @@
1274 -From b3f6b32165d3f437bd0ac6269c3c499b68ecf036 Mon Sep 17 00:00:00 2001
1275 -From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
1276 -Date: Thu, 4 Aug 2016 16:53:18 +0000
1277 -Subject: [PATCH] Fix for PR71696 in Libiberty Demangler
1278 -MIME-Version: 1.0
1279 -Content-Type: text/plain; charset=UTF-8
1280 -Content-Transfer-Encoding: 8bit
1281 -
1282 -[BZ #71696] -- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71696
1283 -
1284 -2016-08-04 Marcel Böhme <boehme.marcel@×××××.com>
1285 -
1286 - PR c++/71696
1287 - * cplus-dem.c: Prevent infinite recursion when there is a cycle
1288 - in the referencing of remembered mangled types.
1289 - (work_stuff): New stack to keep track of the remembered mangled
1290 - types that are currently being processed.
1291 - (push_processed_type): New method to push currently processed
1292 - remembered type onto the stack.
1293 - (pop_processed_type): New method to pop currently processed
1294 - remembered type from the stack.
1295 - (work_stuff_copy_to_from): Copy values of new variables.
1296 - (delete_non_B_K_work_stuff): Free stack memory.
1297 - (demangle_args): Push/Pop currently processed remembered type.
1298 - (do_type): Do not demangle a cyclic reference and push/pop
1299 - referenced remembered type.
1300 -
1301 -cherry-picked from commit of
1302 -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239143 138bc75d-0d04-0410-961f-82ee72b054a4
1303 -
1304 -Upstream-Status: Backport [master]
1305 -CVE: CVE-2016-6131
1306 -Signed-off-by: Yuanjie Huang <yuanjie.huang@×××××××××.com>
1307 ----
1308 - libiberty/ChangeLog | 17 ++++++++
1309 - libiberty/cplus-dem.c | 78 ++++++++++++++++++++++++++++++++---
1310 - libiberty/testsuite/demangle-expected | 18 ++++++++
1311 - 3 files changed, 108 insertions(+), 5 deletions(-)
1312 -
1313 -diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
1314 -index 9859ad3..7939480 100644
1315 ---- a/libiberty/ChangeLog
1316 -+++ b/libiberty/ChangeLog
1317 -@@ -1,3 +1,20 @@
1318 -+2016-08-04 Marcel Böhme <boehme.marcel@×××××.com>
1319 -+
1320 -+ PR c++/71696
1321 -+ * cplus-dem.c: Prevent infinite recursion when there is a cycle
1322 -+ in the referencing of remembered mangled types.
1323 -+ (work_stuff): New stack to keep track of the remembered mangled
1324 -+ types that are currently being processed.
1325 -+ (push_processed_type): New method to push currently processed
1326 -+ remembered type onto the stack.
1327 -+ (pop_processed_type): New method to pop currently processed
1328 -+ remembered type from the stack.
1329 -+ (work_stuff_copy_to_from): Copy values of new variables.
1330 -+ (delete_non_B_K_work_stuff): Free stack memory.
1331 -+ (demangle_args): Push/Pop currently processed remembered type.
1332 -+ (do_type): Do not demangle a cyclic reference and push/pop
1333 -+ referenced remembered type.
1334 -+
1335 - 2016-06-03 Release Manager
1336 -
1337 - * GCC 5.4.0 released.
1338 -diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
1339 -index 7514e57..f21e630 100644
1340 ---- a/libiberty/cplus-dem.c
1341 -+++ b/libiberty/cplus-dem.c
1342 -@@ -144,6 +144,9 @@ struct work_stuff
1343 - string* previous_argument; /* The last function argument demangled. */
1344 - int nrepeats; /* The number of times to repeat the previous
1345 - argument. */
1346 -+ int *proctypevec; /* Indices of currently processed remembered typevecs. */
1347 -+ int proctypevec_size;
1348 -+ int nproctypes;
1349 - };
1350 -
1351 - #define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI)
1352 -@@ -435,6 +438,10 @@ iterate_demangle_function (struct work_stuff *,
1353 -
1354 - static void remember_type (struct work_stuff *, const char *, int);
1355 -
1356 -+static void push_processed_type (struct work_stuff *, int);
1357 -+
1358 -+static void pop_processed_type (struct work_stuff *);
1359 -+
1360 - static void remember_Btype (struct work_stuff *, const char *, int, int);
1361 -
1362 - static int register_Btype (struct work_stuff *);
1363 -@@ -1301,6 +1308,10 @@ work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from)
1364 - memcpy (to->btypevec[i], from->btypevec[i], len);
1365 - }
1366 -
1367 -+ if (from->proctypevec)
1368 -+ to->proctypevec =
1369 -+ XDUPVEC (int, from->proctypevec, from->proctypevec_size);
1370 -+
1371 - if (from->ntmpl_args)
1372 - to->tmpl_argvec = XNEWVEC (char *, from->ntmpl_args);
1373 -
1374 -@@ -1329,11 +1340,17 @@ delete_non_B_K_work_stuff (struct work_stuff *work)
1375 - /* Discard the remembered types, if any. */
1376 -
1377 - forget_types (work);
1378 -- if (work -> typevec != NULL)
1379 -+ if (work->typevec != NULL)
1380 - {
1381 -- free ((char *) work -> typevec);
1382 -- work -> typevec = NULL;
1383 -- work -> typevec_size = 0;
1384 -+ free ((char *) work->typevec);
1385 -+ work->typevec = NULL;
1386 -+ work->typevec_size = 0;
1387 -+ }
1388 -+ if (work->proctypevec != NULL)
1389 -+ {
1390 -+ free (work->proctypevec);
1391 -+ work->proctypevec = NULL;
1392 -+ work->proctypevec_size = 0;
1393 - }
1394 - if (work->tmpl_argvec)
1395 - {
1396 -@@ -3552,6 +3569,8 @@ static int
1397 - do_type (struct work_stuff *work, const char **mangled, string *result)
1398 - {
1399 - int n;
1400 -+ int i;
1401 -+ int is_proctypevec;
1402 - int done;
1403 - int success;
1404 - string decl;
1405 -@@ -3564,6 +3583,7 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
1406 -
1407 - done = 0;
1408 - success = 1;
1409 -+ is_proctypevec = 0;
1410 - while (success && !done)
1411 - {
1412 - int member;
1413 -@@ -3616,8 +3636,15 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
1414 - success = 0;
1415 - }
1416 - else
1417 -+ for (i = 0; i < work->nproctypes; i++)
1418 -+ if (work -> proctypevec [i] == n)
1419 -+ success = 0;
1420 -+
1421 -+ if (success)
1422 - {
1423 -- remembered_type = work -> typevec[n];
1424 -+ is_proctypevec = 1;
1425 -+ push_processed_type (work, n);
1426 -+ remembered_type = work->typevec[n];
1427 - mangled = &remembered_type;
1428 - }
1429 - break;
1430 -@@ -3840,6 +3867,9 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
1431 - string_delete (result);
1432 - string_delete (&decl);
1433 -
1434 -+ if (is_proctypevec)
1435 -+ pop_processed_type (work);
1436 -+
1437 - if (success)
1438 - /* Assume an integral type, if we're not sure. */
1439 - return (int) ((tk == tk_none) ? tk_integral : tk);
1440 -@@ -4252,6 +4282,41 @@ do_arg (struct work_stuff *work, const char **mangled, string *result)
1441 - }
1442 -
1443 - static void
1444 -+push_processed_type (struct work_stuff *work, int typevec_index)
1445 -+{
1446 -+ if (work->nproctypes >= work->proctypevec_size)
1447 -+ {
1448 -+ if (!work->proctypevec_size)
1449 -+ {
1450 -+ work->proctypevec_size = 4;
1451 -+ work->proctypevec = XNEWVEC (int, work->proctypevec_size);
1452 -+ }
1453 -+ else
1454 -+ {
1455 -+ if (work->proctypevec_size < 16)
1456 -+ /* Double when small. */
1457 -+ work->proctypevec_size *= 2;
1458 -+ else
1459 -+ {
1460 -+ /* Grow slower when large. */
1461 -+ if (work->proctypevec_size > (INT_MAX / 3) * 2)
1462 -+ xmalloc_failed (INT_MAX);
1463 -+ work->proctypevec_size = (work->proctypevec_size * 3 / 2);
1464 -+ }
1465 -+ work->proctypevec
1466 -+ = XRESIZEVEC (int, work->proctypevec, work->proctypevec_size);
1467 -+ }
1468 -+ }
1469 -+ work->proctypevec [work->nproctypes++] = typevec_index;
1470 -+}
1471 -+
1472 -+static void
1473 -+pop_processed_type (struct work_stuff *work)
1474 -+{
1475 -+ work->nproctypes--;
1476 -+}
1477 -+
1478 -+static void
1479 - remember_type (struct work_stuff *work, const char *start, int len)
1480 - {
1481 - char *tem;
1482 -@@ -4515,10 +4580,13 @@ demangle_args (struct work_stuff *work, const char **mangled,
1483 - {
1484 - string_append (declp, ", ");
1485 - }
1486 -+ push_processed_type (work, t);
1487 - if (!do_arg (work, &tem, &arg))
1488 - {
1489 -+ pop_processed_type (work);
1490 - return (0);
1491 - }
1492 -+ pop_processed_type (work);
1493 - if (PRINT_ARG_TYPES)
1494 - {
1495 - string_appends (declp, &arg);
1496 -diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
1497 -index 1d8b771..d690b23 100644
1498 ---- a/libiberty/testsuite/demangle-expected
1499 -+++ b/libiberty/testsuite/demangle-expected
1500 -@@ -4429,3 +4429,21 @@ __vt_90000000000cafebabe
1501 -
1502 - _Z80800000000000000000000
1503 - _Z80800000000000000000000
1504 -+#
1505 -+# Tests write access violation PR70926
1506 -+
1507 -+0__Ot2m02R5T0000500000
1508 -+0__Ot2m02R5T0000500000
1509 -+#
1510 -+
1511 -+0__GT50000000000_
1512 -+0__GT50000000000_
1513 -+#
1514 -+
1515 -+__t2m05B500000000000000000_
1516 -+__t2m05B500000000000000000_
1517 -+#
1518 -+# Tests stack overflow PR71696
1519 -+
1520 -+__10%0__S4_0T0T0
1521 -+%0<>::%0(%0<>)
1522 ---
1523 -2.9.3
1524 -
1525 -
1526
1527 diff --git a/sys-devel/gcc/files/gcc-7.2.0-pr69728.patch b/sys-devel/gcc/files/gcc-7.2.0-pr69728.patch
1528 deleted file mode 100644
1529 index ca5eedc..0000000
1530 --- a/sys-devel/gcc/files/gcc-7.2.0-pr69728.patch
1531 +++ /dev/null
1532 @@ -1,26 +0,0 @@
1533 -diff -Naur gcc-7.2.0.orig/gcc/graphite-sese-to-poly.c gcc-7.2.0/gcc/graphite-sese-to-poly.c
1534 ---- gcc-7.2.0.orig/gcc/graphite-sese-to-poly.c 2017-11-29 12:32:19.000188886 -0800
1535 -+++ gcc-7.2.0/gcc/graphite-sese-to-poly.c 2017-11-29 12:32:35.858188584 -0800
1536 -@@ -1043,6 +1043,14 @@
1537 - if (empty < 0 || empty)
1538 - return empty < 0 ? isl_schedule_free (schedule) : schedule;
1539 -
1540 -+ isl_union_set *domain = isl_schedule_get_domain (schedule);
1541 -+ /* We cannot apply an empty domain to pbbs in this loop so return early. */
1542 -+ if (isl_union_set_is_empty (domain))
1543 -+ {
1544 -+ isl_union_set_free (domain);
1545 -+ return schedule;
1546 -+ }
1547 -+
1548 - isl_space *space = isl_set_get_space (iterators);
1549 - int loop_index = isl_space_dim (space, isl_dim_set) - 1;
1550 -
1551 -@@ -1063,7 +1071,6 @@
1552 - prefix = isl_multi_aff_set_tuple_id (prefix, isl_dim_out, label);
1553 -
1554 - int n = isl_multi_aff_dim (prefix, isl_dim_in);
1555 -- isl_union_set *domain = isl_schedule_get_domain (schedule);
1556 - isl_multi_union_pw_aff *mupa = outer_projection_mupa (domain, n);
1557 - mupa = isl_multi_union_pw_aff_apply_multi_aff (mupa, prefix);
1558 - return isl_schedule_insert_partial_schedule (schedule, mupa);
1559
1560 diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
1561 deleted file mode 100644
1562 index d1b1b03..0000000
1563 --- a/sys-devel/gcc/files/gcc-configure-LANG.patch
1564 +++ /dev/null
1565 @@ -1,64 +0,0 @@
1566 -The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
1567 -option parsing, it may break.
1568 -
1569 -http://bugs.gentoo.org/103483
1570 -
1571 ---- configure
1572 -+++ configure
1573 -@@ -54,6 +54,19 @@
1574 - infodir='${prefix}/info'
1575 - mandir='${prefix}/man'
1576 -
1577 -+# NLS nuisances.
1578 -+for as_var in \
1579 -+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
1580 -+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
1581 -+ LC_TELEPHONE LC_TIME
1582 -+do
1583 -+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
1584 -+ eval $as_var=C; export $as_var
1585 -+ else
1586 -+ unset $as_var
1587 -+ fi
1588 -+done
1589 -+
1590 - # Initialize some other variables.
1591 - subdirs=
1592 - MFLAGS= MAKEFLAGS=
1593 -@@ -452,16 +463,6 @@
1594 - esac
1595 - done
1596 -
1597 --# NLS nuisances.
1598 --# Only set these to C if already set. These must not be set unconditionally
1599 --# because not all systems understand e.g. LANG=C (notably SCO).
1600 --# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
1601 --# Non-C LC_CTYPE values break the ctype check.
1602 --if test "${LANG+set}" = set; then LANG=C; export LANG; fi
1603 --if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
1604 --if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
1605 --if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
1606 --
1607 - # confdefs.h avoids OS command line length limits that DEFS can exceed.
1608 - rm -rf conftest* confdefs.h
1609 - # AIX cpp loses on an empty file, so make sure it contains at least a newline.
1610 -@@ -1850,6 +1850,19 @@
1611 - # Compiler output produced by configure, useful for debugging
1612 - # configure, is in ./config.log if it exists.
1613 -
1614 -+# NLS nuisances.
1615 -+for as_var in \
1616 -+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
1617 -+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
1618 -+ LC_TELEPHONE LC_TIME
1619 -+do
1620 -+ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
1621 -+ eval \$as_var=C; export \$as_var
1622 -+ else
1623 -+ unset \$as_var
1624 -+ fi
1625 -+done
1626 -+
1627 - ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1628 - for ac_option
1629 - do
1630
1631 diff --git a/sys-devel/gcc/files/gcc-spec-env-r1.patch b/sys-devel/gcc/files/gcc-spec-env-r1.patch
1632 deleted file mode 100644
1633 index a589268..0000000
1634 --- a/sys-devel/gcc/files/gcc-spec-env-r1.patch
1635 +++ /dev/null
1636 @@ -1,87 +0,0 @@
1637 -2013-08-22 Magnus Granberg <zorry@g.o>
1638 -
1639 - * gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
1640 - and move the process of the user specifed specs.
1641 -
1642 - This allows us to easily control pie/ssp defaults with gcc-config profiles.
1643 - Original patch by Rob Holland
1644 - Extended to support multiple entries separated by ':' by Kevin F. Quinn
1645 - Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
1646 - Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
1647 -
1648 ---- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100
1649 -+++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200
1650 -@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
1651 - do_option_spec (option_default_specs[i].name,
1652 - option_default_specs[i].spec);
1653 -
1654 -+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
1655 -+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
1656 -+ * each spec listed, the string is overwritten at token boundaries
1657 -+ * (':') with '\0', an effect of strtok_r().
1658 -+ */
1659 -+ specs_file = getenv ("GCC_SPECS");
1660 -+ if (specs_file && (strlen(specs_file) > 0))
1661 -+ {
1662 -+ char *spec, *saveptr;
1663 -+ for (spec=strtok_r(specs_file,":",&saveptr);
1664 -+ spec!=NULL;
1665 -+ spec=strtok_r(NULL,":",&saveptr))
1666 -+ {
1667 -+ struct user_specs *user = (struct user_specs *)
1668 -+ xmalloc (sizeof (struct user_specs));
1669 -+ user->next = (struct user_specs *) 0;
1670 -+ user->filename = spec;
1671 -+ if (user_specs_tail)
1672 -+ user_specs_tail->next = user;
1673 -+ else
1674 -+ user_specs_head = user;
1675 -+ user_specs_tail = user;
1676 -+ }
1677 -+ }
1678 -+#endif
1679 -+ /* Process any user specified specs in the order given on the command
1680 -+ * line. */
1681 -+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
1682 -+ {
1683 -+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
1684 -+ R_OK, true);
1685 -+ read_specs (filename ? filename : uptr->filename, false, true);
1686 -+ }
1687 -+ /* Process any user self specs. */
1688 -+ {
1689 -+ struct spec_list *sl;
1690 -+ for (sl = specs; sl; sl = sl->next)
1691 -+ if (sl->name_len == sizeof "self_spec" - 1
1692 -+ && !strcmp (sl->name, "self_spec"))
1693 -+ do_self_spec (*sl->ptr_spec);
1694 -+ }
1695 -+
1696 - /* Process DRIVER_SELF_SPECS, adding any new options to the end
1697 - of the command line. */
1698 -
1699 -@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
1700 - PREFIX_PRIORITY_LAST, 0, 1);
1701 - }
1702 -
1703 -- /* Process any user specified specs in the order given on the command
1704 -- line. */
1705 -- for (uptr = user_specs_head; uptr; uptr = uptr->next)
1706 -- {
1707 -- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
1708 -- R_OK, true);
1709 -- read_specs (filename ? filename : uptr->filename, false, true);
1710 -- }
1711 --
1712 -- /* Process any user self specs. */
1713 -- {
1714 -- struct spec_list *sl;
1715 -- for (sl = specs; sl; sl = sl->next)
1716 -- if (sl->name_len == sizeof "self_spec" - 1
1717 -- && !strcmp (sl->name, "self_spec"))
1718 -- do_self_spec (*sl->ptr_spec);
1719 -- }
1720 --
1721 - if (compare_debug)
1722 - {
1723 - enum save_temps save;
1724
1725 diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
1726 deleted file mode 100644
1727 index 57e7567..0000000
1728 --- a/sys-devel/gcc/files/gcc-spec-env.patch
1729 +++ /dev/null
1730 @@ -1,42 +0,0 @@
1731 - Add support for external spec file via the GCC_SPECS env var. This
1732 - allows us to easily control pie/ssp defaults with gcc-config profiles.
1733 -
1734 - Original patch by Rob Holland
1735 - Extended to support multiple entries separated by ':' by Kevin F. Quinn
1736 - Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
1737 -
1738 ---- gcc-4/gcc/gcc.c
1739 -+++ gcc-4/gcc/gcc.c
1740 -@@ -6482,6 +6482,32 @@
1741 -
1742 - /* Process any user specified specs in the order given on the command
1743 - line. */
1744 -+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
1745 -+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
1746 -+ * each spec listed, the string is overwritten at token boundaries
1747 -+ * (':') with '\0', an effect of strtok_r().
1748 -+ */
1749 -+ specs_file = getenv ("GCC_SPECS");
1750 -+ if (specs_file && (strlen(specs_file) > 0))
1751 -+ {
1752 -+ char *spec, *saveptr;
1753 -+ for (spec=strtok_r(specs_file,":",&saveptr);
1754 -+ spec!=NULL;
1755 -+ spec=strtok_r(NULL,":",&saveptr))
1756 -+ {
1757 -+ struct user_specs *user = (struct user_specs *)
1758 -+ xmalloc (sizeof (struct user_specs));
1759 -+
1760 -+ user->next = (struct user_specs *) 0;
1761 -+ user->filename = spec;
1762 -+ if (user_specs_tail)
1763 -+ user_specs_tail->next = user;
1764 -+ else
1765 -+ user_specs_head = user;
1766 -+ user_specs_tail = user;
1767 -+ }
1768 -+ }
1769 -+#endif
1770 - for (uptr = user_specs_head; uptr; uptr = uptr->next)
1771 - {
1772 - char *filename = find_a_file (&startfile_prefixes, uptr->filename,
1773
1774 diff --git a/sys-devel/gcc/gcc-6.4.0-r1.ebuild b/sys-devel/gcc/gcc-6.4.0-r1.ebuild
1775 deleted file mode 100644
1776 index 2298161..0000000
1777 --- a/sys-devel/gcc/gcc-6.4.0-r1.ebuild
1778 +++ /dev/null
1779 @@ -1,35 +0,0 @@
1780 -# Copyright 1999-2018 Gentoo Foundation
1781 -# Distributed under the terms of the GNU General Public License v2
1782 -
1783 -EAPI="5"
1784 -
1785 -PATCH_VER="1.3"
1786 -UCLIBC_VER="1.0"
1787 -
1788 -inherit toolchain
1789 -
1790 -KEYWORDS="amd64 arm arm64 ~mips ppc x86"
1791 -
1792 -RDEPEND=""
1793 -DEPEND="${RDEPEND}
1794 - elibc_glibc? ( >=sys-libs/glibc-2.13 )
1795 - >=${CATEGORY}/binutils-2.20"
1796 -
1797 -if [[ ${CATEGORY} != cross-* ]] ; then
1798 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
1799 -fi
1800 -
1801 -src_prepare() {
1802 - toolchain_src_prepare
1803 -
1804 - # Upstream Patch
1805 - epatch "${FILESDIR}"/${PN}-5.4.0-pr70473.patch
1806 -
1807 - if use elibc_musl || [[ ${CATEGORY} = cross-*-musl* ]]; then
1808 - epatch "${FILESDIR}"/4.9.4/boehm_gc.patch
1809 - epatch "${FILESDIR}"/5.4.0/cilkrts.patch
1810 - epatch "${FILESDIR}"/6.3.0/cpu_indicator.patch
1811 - epatch "${FILESDIR}"/6.3.0/musl.patch
1812 - epatch "${FILESDIR}"/7.1.0/posix_memalign.patch
1813 - fi
1814 -}
1815
1816 diff --git a/sys-devel/gcc/gcc-7.3.0-r3.ebuild b/sys-devel/gcc/gcc-7.3.0-r3.ebuild
1817 deleted file mode 100644
1818 index 974c675..0000000
1819 --- a/sys-devel/gcc/gcc-7.3.0-r3.ebuild
1820 +++ /dev/null
1821 @@ -1,31 +0,0 @@
1822 -# Copyright 1999-2018 Gentoo Foundation
1823 -# Distributed under the terms of the GNU General Public License v2
1824 -
1825 -EAPI="5"
1826 -
1827 -PATCH_VER="1.4"
1828 -#UCLIBC_VER="1.0"
1829 -
1830 -inherit epatch toolchain
1831 -
1832 -KEYWORDS="amd64 arm arm64 ~mips ppc x86"
1833 -
1834 -RDEPEND=""
1835 -DEPEND="${RDEPEND}
1836 - elibc_glibc? ( >=sys-libs/glibc-2.13 )
1837 - >=${CATEGORY}/binutils-2.20"
1838 -
1839 -if [[ ${CATEGORY} != cross-* ]] ; then
1840 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
1841 -fi
1842 -
1843 -src_prepare() {
1844 - toolchain_src_prepare
1845 -
1846 - epatch "${FILESDIR}"/gcc-7.2.0-pr69728.patch
1847 -
1848 - if use elibc_musl || [[ ${CATEGORY} = cross-*-musl* ]]; then
1849 - epatch "${FILESDIR}"/6.3.0/cpu_indicator.patch
1850 - epatch "${FILESDIR}"/7.1.0/posix_memalign.patch
1851 - fi
1852 -}
1853
1854 diff --git a/sys-devel/gcc/gcc-7.3.0-r6.ebuild b/sys-devel/gcc/gcc-7.3.0-r6.ebuild
1855 deleted file mode 100644
1856 index 64dfcf5..0000000
1857 --- a/sys-devel/gcc/gcc-7.3.0-r6.ebuild
1858 +++ /dev/null
1859 @@ -1,31 +0,0 @@
1860 -# Copyright 1999-2018 Gentoo Foundation
1861 -# Distributed under the terms of the GNU General Public License v2
1862 -
1863 -EAPI="5"
1864 -
1865 -PATCH_VER="1.8"
1866 -#UCLIBC_VER="1.0"
1867 -
1868 -inherit epatch toolchain
1869 -
1870 -KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
1871 -
1872 -RDEPEND=""
1873 -DEPEND="${RDEPEND}
1874 - elibc_glibc? ( >=sys-libs/glibc-2.13 )
1875 - >=${CATEGORY}/binutils-2.20"
1876 -
1877 -if [[ ${CATEGORY} != cross-* ]] ; then
1878 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
1879 -fi
1880 -
1881 -src_prepare() {
1882 - toolchain_src_prepare
1883 -
1884 - epatch "${FILESDIR}"/gcc-7.2.0-pr69728.patch
1885 -
1886 - if use elibc_musl || [[ ${CATEGORY} = cross-*-musl* ]]; then
1887 - epatch "${FILESDIR}"/6.3.0/cpu_indicator.patch
1888 - epatch "${FILESDIR}"/7.1.0/posix_memalign.patch
1889 - fi
1890 -}
1891
1892 diff --git a/sys-devel/gcc/gcc-7.4.0.ebuild b/sys-devel/gcc/gcc-7.4.0.ebuild
1893 deleted file mode 100644
1894 index 8410c02..0000000
1895 --- a/sys-devel/gcc/gcc-7.4.0.ebuild
1896 +++ /dev/null
1897 @@ -1,31 +0,0 @@
1898 -# Copyright 1999-2018 Gentoo Foundation
1899 -# Distributed under the terms of the GNU General Public License v2
1900 -
1901 -EAPI="5"
1902 -
1903 -PATCH_VER="1.1"
1904 -#UCLIBC_VER="1.0"
1905 -
1906 -inherit epatch toolchain
1907 -
1908 -KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
1909 -
1910 -RDEPEND=""
1911 -DEPEND="${RDEPEND}
1912 - elibc_glibc? ( >=sys-libs/glibc-2.13 )
1913 - >=${CATEGORY}/binutils-2.20"
1914 -
1915 -if [[ ${CATEGORY} != cross-* ]] ; then
1916 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
1917 -fi
1918 -
1919 -src_prepare() {
1920 - toolchain_src_prepare
1921 -
1922 - epatch "${FILESDIR}"/gcc-7.2.0-pr69728.patch
1923 -
1924 - if use elibc_musl || [[ ${CATEGORY} = cross-*-musl* ]]; then
1925 - epatch "${FILESDIR}"/6.3.0/cpu_indicator.patch
1926 - epatch "${FILESDIR}"/7.1.0/posix_memalign.patch
1927 - fi
1928 -}
1929
1930 diff --git a/sys-devel/gcc/gcc-8.2.0-r5.ebuild b/sys-devel/gcc/gcc-8.2.0-r5.ebuild
1931 deleted file mode 100644
1932 index 79f2c9c..0000000
1933 --- a/sys-devel/gcc/gcc-8.2.0-r5.ebuild
1934 +++ /dev/null
1935 @@ -1,29 +0,0 @@
1936 -# Copyright 1999-2018 Gentoo Foundation
1937 -# Distributed under the terms of the GNU General Public License v2
1938 -
1939 -EAPI="5"
1940 -
1941 -PATCH_VER="1.6"
1942 -#UCLIBC_VER="1.0"
1943 -
1944 -inherit toolchain
1945 -
1946 -KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
1947 -
1948 -RDEPEND=""
1949 -DEPEND="${RDEPEND}
1950 - elibc_glibc? ( >=sys-libs/glibc-2.13 )
1951 - >=${CATEGORY}/binutils-2.20"
1952 -
1953 -if [[ ${CATEGORY} != cross-* ]] ; then
1954 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
1955 -fi
1956 -
1957 -src_prepare() {
1958 - toolchain_src_prepare
1959 -
1960 - if use elibc_musl || [[ ${CATEGORY} = cross-*-musl* ]]; then
1961 - epatch "${FILESDIR}"/6.3.0/cpu_indicator.patch
1962 - epatch "${FILESDIR}"/7.1.0/posix_memalign.patch
1963 - fi
1964 -}
1965
1966 diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
1967 index d6001b2..6a2c985 100644
1968 --- a/sys-devel/gcc/metadata.xml
1969 +++ b/sys-devel/gcc/metadata.xml
1970 @@ -6,9 +6,6 @@
1971 <name>Gentoo Toolchain Project</name>
1972 </maintainer>
1973 <use>
1974 - <flag name="awt">Useful only when building GCJ, this enables Abstract Window Toolkit
1975 - (AWT) peer support on top of GTK+</flag>
1976 - <flag name="cilk">Support the Cilk Plus language (C/C++ based languages for parallel programming)</flag>
1977 <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
1978 in gcc (Warning: significantly increases compile time!)</flag>
1979 <flag name="go">Build the GCC Go language frontend.</flag>