1 |
commit: 51a9de2148ce23dc564e4306459221041caf82ca |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 8 03:44:28 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 8 03:45:50 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=51a9de21 |
7 |
|
8 |
11.3.0: copy 11.2.0 musl patches |
9 |
|
10 |
As-is. Same as 11.2.0. |
11 |
|
12 |
See: 80b2ddbd24304d3ccbfc7a8cd5cebcafe2c25b61 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
11.3.0/musl/25_all_multilib_pure64.patch | 86 ++++++++++++++++++++++ |
16 |
11.3.0/musl/50_all_cpu_indicator.patch | 46 ++++++++++++ |
17 |
11.3.0/musl/50_all_posix_memalign.patch | 29 ++++++++ |
18 |
.../nocross/50_all_libssp_unconditionally.patch | 20 +++++ |
19 |
4 files changed, 181 insertions(+) |
20 |
|
21 |
diff --git a/11.3.0/musl/25_all_multilib_pure64.patch b/11.3.0/musl/25_all_multilib_pure64.patch |
22 |
new file mode 100644 |
23 |
index 0000000..19fd5c9 |
24 |
--- /dev/null |
25 |
+++ b/11.3.0/musl/25_all_multilib_pure64.patch |
26 |
@@ -0,0 +1,86 @@ |
27 |
+diff -Naur gcc-9.3.0.orig/gcc/config/aarch64/t-aarch64-linux gcc-9.3.0/gcc/config/aarch64/t-aarch64-linux |
28 |
+--- gcc-9.3.0.orig/gcc/config/aarch64/t-aarch64-linux 2020-10-05 02:59:12.767988285 -0700 |
29 |
++++ gcc-9.3.0/gcc/config/aarch64/t-aarch64-linux 2020-10-05 03:03:32.310816444 -0700 |
30 |
+@@ -22,7 +22,7 @@ |
31 |
+ LIB1ASMFUNCS = _aarch64_sync_cache_range |
32 |
+ |
33 |
+ AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) |
34 |
+-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) |
35 |
++MULTILIB_OSDIRNAMES = mabi.lp64=../lib |
36 |
+ MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) |
37 |
+ |
38 |
+ MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) |
39 |
+diff -Naur gcc-9.3.0.orig/gcc/config/i386/t-linux64 gcc-9.3.0/gcc/config/i386/t-linux64 |
40 |
+--- gcc-9.3.0.orig/gcc/config/i386/t-linux64 2020-10-05 02:59:12.757989347 -0700 |
41 |
++++ gcc-9.3.0/gcc/config/i386/t-linux64 2020-10-05 03:24:58.878825272 -0700 |
42 |
+@@ -33,6 +33,6 @@ |
43 |
+ comma=, |
44 |
+ MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) |
45 |
+ MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) |
46 |
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) |
47 |
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) |
48 |
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) |
49 |
++MULTILIB_OSDIRNAMES = m64=../lib |
50 |
++MULTILIB_OSDIRNAMES+= m32=../lib32 |
51 |
++MULTILIB_OSDIRNAMES+= mx32=../libx32 |
52 |
+diff -Naur gcc-9.3.0.orig/gcc/config/rs6000/t-linux gcc-9.3.0/gcc/config/rs6000/t-linux |
53 |
+--- gcc-9.3.0.orig/gcc/config/rs6000/t-linux 2020-10-05 02:59:12.767988285 -0700 |
54 |
++++ gcc-9.3.0/gcc/config/rs6000/t-linux 2020-10-05 03:03:32.310816444 -0700 |
55 |
+@@ -2,7 +2,8 @@ |
56 |
+ # or soft-float. |
57 |
+ ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) |
58 |
+ ifneq (,$(findstring powerpc64,$(target))) |
59 |
+-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) |
60 |
++MULTILIB_OSDIRNAMES := m64=../lib |
61 |
++MULTILIB_OSDIRNAMES += m32=../lib32 |
62 |
+ else |
63 |
+ MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) |
64 |
+ endif |
65 |
+@@ -10,7 +11,8 @@ |
66 |
+ MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) |
67 |
+ endif |
68 |
+ ifneq (,$(findstring powerpc64le,$(target))) |
69 |
+-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) |
70 |
++MULTILIB_OSDIRNAMES := m64=../lib |
71 |
++MULTILIB_OSDIRNAMES += m32=../lib32 |
72 |
+ endif |
73 |
+ endif |
74 |
+ |
75 |
+diff -Naur gcc-9.3.0.orig/gcc/config/rs6000/t-linux64 gcc-9.3.0/gcc/config/rs6000/t-linux64 |
76 |
+--- gcc-9.3.0.orig/gcc/config/rs6000/t-linux64 2020-10-05 02:59:12.767988285 -0700 |
77 |
++++ gcc-9.3.0/gcc/config/rs6000/t-linux64 2020-10-05 03:03:32.310816444 -0700 |
78 |
+@@ -28,8 +28,8 @@ |
79 |
+ MULTILIB_OPTIONS := m64/m32 |
80 |
+ MULTILIB_DIRNAMES := 64 32 |
81 |
+ MULTILIB_EXTRA_OPTS := |
82 |
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) |
83 |
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) |
84 |
++MULTILIB_OSDIRNAMES := m64=../lib |
85 |
++MULTILIB_OSDIRNAMES += m32=../lib32 |
86 |
+ |
87 |
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c |
88 |
+ $(COMPILE) $< |
89 |
+diff -Naur gcc-9.3.0.orig/gcc/config/rs6000/t-linux64bele gcc-9.3.0/gcc/config/rs6000/t-linux64bele |
90 |
+--- gcc-9.3.0.orig/gcc/config/rs6000/t-linux64bele 2020-10-05 02:59:12.767988285 -0700 |
91 |
++++ gcc-9.3.0/gcc/config/rs6000/t-linux64bele 2020-10-05 03:03:32.310816444 -0700 |
92 |
+@@ -2,6 +2,6 @@ |
93 |
+ |
94 |
+ MULTILIB_OPTIONS += mlittle |
95 |
+ MULTILIB_DIRNAMES += le |
96 |
+-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) |
97 |
+-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) |
98 |
++MULTILIB_OSDIRNAMES = m64=../lib |
99 |
++MULTILIB_OSDIRNAMES+= m32=../lib32 |
100 |
+ MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} |
101 |
+diff -Naur gcc-9.3.0.orig/gcc/config/rs6000/t-linux64lebe gcc-9.3.0/gcc/config/rs6000/t-linux64lebe |
102 |
+--- gcc-9.3.0.orig/gcc/config/rs6000/t-linux64lebe 2020-10-05 02:59:12.777987222 -0700 |
103 |
++++ gcc-9.3.0/gcc/config/rs6000/t-linux64lebe 2020-10-05 03:03:32.310816444 -0700 |
104 |
+@@ -2,6 +2,6 @@ |
105 |
+ |
106 |
+ MULTILIB_OPTIONS += mbig |
107 |
+ MULTILIB_DIRNAMES += be |
108 |
+-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) |
109 |
+-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) |
110 |
++MULTILIB_OSDIRNAMES := m64=../lib |
111 |
++MULTILIB_OSDIRNAMES += m32=../lib32 |
112 |
+ MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} |
113 |
|
114 |
diff --git a/11.3.0/musl/50_all_cpu_indicator.patch b/11.3.0/musl/50_all_cpu_indicator.patch |
115 |
new file mode 100644 |
116 |
index 0000000..6141a83 |
117 |
--- /dev/null |
118 |
+++ b/11.3.0/musl/50_all_cpu_indicator.patch |
119 |
@@ -0,0 +1,46 @@ |
120 |
+From d16a8ceb1c3c8a7ec381090b4c316ff4c55661c0 Mon Sep 17 00:00:00 2001 |
121 |
+From: |
122 |
+Date: Thu, 7 May 2020 21:14:11 -0500 |
123 |
+Subject: [PATCH] convert "__cpu_indicator_init" to |
124 |
+ "__cpu_indicator_init_local" |
125 |
+ |
126 |
+--- |
127 |
+ gcc/config/i386/i386-expand.c | 4 ++-- |
128 |
+ libgcc/config/i386/cpuinfo.c | 6 +++--- |
129 |
+ 2 files changed, 5 insertions(+), 5 deletions(-) |
130 |
+ |
131 |
+diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c |
132 |
+index 48f00c5fc..78650b202 100644 |
133 |
+--- a/gcc/config/i386/i386-expand.c |
134 |
++++ b/gcc/config/i386/i386-expand.c |
135 |
+@@ -10941,10 +10941,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, |
136 |
+ { |
137 |
+ case IX86_BUILTIN_CPU_INIT: |
138 |
+ { |
139 |
+- /* Make it call __cpu_indicator_init in libgcc. */ |
140 |
++ /* Make it call __cpu_indicator_init_local in libgcc. */ |
141 |
+ tree call_expr, fndecl, type; |
142 |
+ type = build_function_type_list (integer_type_node, NULL_TREE); |
143 |
+- fndecl = build_fn_decl ("__cpu_indicator_init", type); |
144 |
++ fndecl = build_fn_decl ("__cpu_indicator_init_local", type); |
145 |
+ call_expr = build_call_expr (fndecl, 0); |
146 |
+ return expand_expr (call_expr, target, mode, EXPAND_NORMAL); |
147 |
+ } |
148 |
+diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c |
149 |
+index 00322c586..f42bbb8af 100644 |
150 |
+--- a/libgcc/config/i386/cpuinfo.c |
151 |
++++ b/libgcc/config/i386/cpuinfo.c |
152 |
+@@ -508,7 +508,7 @@ __cpu_indicator_init (void) |
153 |
+ return 0; |
154 |
+ } |
155 |
+ |
156 |
+-#if defined SHARED && defined USE_ELF_SYMVER |
157 |
+-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); |
158 |
+-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); |
159 |
++#ifndef SHARED |
160 |
++int __cpu_indicator_init_local (void) |
161 |
++ __attribute__ ((weak, alias ("__cpu_indicator_init"))); |
162 |
+ #endif |
163 |
+-- |
164 |
+2.26.2 |
165 |
+ |
166 |
|
167 |
diff --git a/11.3.0/musl/50_all_posix_memalign.patch b/11.3.0/musl/50_all_posix_memalign.patch |
168 |
new file mode 100644 |
169 |
index 0000000..a288e1d |
170 |
--- /dev/null |
171 |
+++ b/11.3.0/musl/50_all_posix_memalign.patch |
172 |
@@ -0,0 +1,29 @@ |
173 |
+diff -Naur gcc-7.1.0.orig/gcc/config/i386/pmm_malloc.h gcc-7.1.0/gcc/config/i386/pmm_malloc.h |
174 |
+--- gcc-7.1.0.orig/gcc/config/i386/pmm_malloc.h 2017-01-01 04:07:43.000000000 -0800 |
175 |
++++ gcc-7.1.0/gcc/config/i386/pmm_malloc.h 2017-05-07 11:35:22.878398460 -0700 |
176 |
+@@ -27,12 +27,13 @@ |
177 |
+ #include <stdlib.h> |
178 |
+ |
179 |
+ /* We can't depend on <stdlib.h> since the prototype of posix_memalign |
180 |
+- may not be visible. */ |
181 |
++ may not be visible and we can't pollute the namespace either. */ |
182 |
+ #ifndef __cplusplus |
183 |
+-extern int posix_memalign (void **, size_t, size_t); |
184 |
++extern int __gcc_posix_memalign (void **, size_t, size_t) |
185 |
+ #else |
186 |
+-extern "C" int posix_memalign (void **, size_t, size_t) throw (); |
187 |
++extern "C" int __gcc_posix_memalign (void **, size_t, size_t) throw () |
188 |
+ #endif |
189 |
++__asm__("posix_memalign"); |
190 |
+ |
191 |
+ static __inline void * |
192 |
+ _mm_malloc (size_t __size, size_t __alignment) |
193 |
+@@ -42,7 +43,7 @@ |
194 |
+ return malloc (__size); |
195 |
+ if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4)) |
196 |
+ __alignment = sizeof (void *); |
197 |
+- if (posix_memalign (&__ptr, __alignment, __size) == 0) |
198 |
++ if (__gcc_posix_memalign (&__ptr, __alignment, __size) == 0) |
199 |
+ return __ptr; |
200 |
+ else |
201 |
+ return NULL; |
202 |
|
203 |
diff --git a/11.3.0/musl/nocross/50_all_libssp_unconditionally.patch b/11.3.0/musl/nocross/50_all_libssp_unconditionally.patch |
204 |
new file mode 100644 |
205 |
index 0000000..fe5c614 |
206 |
--- /dev/null |
207 |
+++ b/11.3.0/musl/nocross/50_all_libssp_unconditionally.patch |
208 |
@@ -0,0 +1,20 @@ |
209 |
+Author: Timo Teräs <timo.teras@×××.fi> |
210 |
+ |
211 |
+Alpine musl package provides libssp_nonshared.a. We link to it unconditionally, |
212 |
+as otherwise we get link failures if some objects are -fstack-protector built |
213 |
+and final link happens with -fno-stack-protector. This seems to be the common |
214 |
+case when bootstrapping gcc, the piepatches do not seem to fully fix the |
215 |
+crosstoolchain and bootstrap sequence wrt. stack-protector flag usage. |
216 |
+ |
217 |
+--- gcc-6.1.0/gcc/gcc.c.orig |
218 |
++++ gcc-6.1.0/gcc/gcc.c |
219 |
+@@ -870,8 +870,7 @@ |
220 |
+ |
221 |
+ #ifndef LINK_SSP_SPEC |
222 |
+ #ifdef TARGET_LIBC_PROVIDES_SSP |
223 |
+-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ |
224 |
+- "|fstack-protector-strong|fstack-protector-explicit:}" |
225 |
++#define LINK_SSP_SPEC "-lssp_nonshared" |
226 |
+ #else |
227 |
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ |
228 |
+ "|fstack-protector-strong|fstack-protector-explicit" \ |