public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/musl/
@ 2024-05-24  4:01 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-05-24  4:01 UTC (permalink / raw
  To: gentoo-commits

commit:     385edffe90a1c3120bfc5d8d286770107d506a3d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 04:00:59 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 24 04:00:59 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=385edffe

14.1.0: add musl patches

Signed-off-by: Sam James <sam <AT> gentoo.org>

 14.1.0/musl/25_all_multilib_pure64.patch        | 83 +++++++++++++++++++++++++
 14.1.0/musl/50_all_cpu_indicator.patch          | 37 +++++++++++
 14.1.0/musl/50_all_libssp_unconditionally.patch | 24 +++++++
 14.1.0/musl/50_all_posix_memalign.patch         | 28 +++++++++
 14.1.0/musl/README.history                      |  6 ++
 5 files changed, 178 insertions(+)

diff --git a/14.1.0/musl/25_all_multilib_pure64.patch b/14.1.0/musl/25_all_multilib_pure64.patch
new file mode 100644
index 0000000..d55c04c
--- /dev/null
+++ b/14.1.0/musl/25_all_multilib_pure64.patch
@@ -0,0 +1,83 @@
+https://bugs.gentoo.org/675954
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077
+
+--- a/gcc/config/aarch64/t-aarch64-linux
++++ b/gcc/config/aarch64/t-aarch64-linux
+@@ -22,7 +22,7 @@
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+ 
+ AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++MULTILIB_OSDIRNAMES = mabi.lp64=../lib
+ MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+ 
+ MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
+--- a/gcc/config/i386/t-linux64
++++ b/gcc/config/i386/t-linux64
+@@ -33,6 +33,6 @@
+ comma=,
+ MULTILIB_OPTIONS    = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+ MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_OSDIRNAMES = m64=../lib
++MULTILIB_OSDIRNAMES+= m32=../lib32
++MULTILIB_OSDIRNAMES+= mx32=../libx32
+--- a/gcc/config/rs6000/t-linux
++++ b/gcc/config/rs6000/t-linux
+@@ -2,7 +2,8 @@
+ # or soft-float.
+ ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
+ ifneq (,$(findstring powerpc64,$(target)))
+-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
++MULTILIB_OSDIRNAMES := m64=../lib
++MULTILIB_OSDIRNAMES += m32=../lib32
+ else
+ MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
+ endif
+@@ -10,7 +11,8 @@
+ MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
+ endif
+ ifneq (,$(findstring powerpc64le,$(target)))
+-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))
++MULTILIB_OSDIRNAMES := m64=../lib
++MULTILIB_OSDIRNAMES += m32=../lib32
+ endif
+ endif
+ 
+--- a/gcc/config/rs6000/t-linux64
++++ b/gcc/config/rs6000/t-linux64
+@@ -28,8 +28,8 @@
+ MULTILIB_OPTIONS    := m64/m32
+ MULTILIB_DIRNAMES   := 64 32
+ MULTILIB_EXTRA_OPTS := 
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := m64=../lib
++MULTILIB_OSDIRNAMES += m32=../lib32
+ 
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
+ 	$(COMPILE) $<
+--- a/gcc/config/rs6000/t-linux64bele
++++ b/gcc/config/rs6000/t-linux64bele
+@@ -2,6 +2,6 @@
+ 
+ MULTILIB_OPTIONS    += mlittle
+ MULTILIB_DIRNAMES   += le
+-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES))))))
+-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES)))
++MULTILIB_OSDIRNAMES = m64=../lib
++MULTILIB_OSDIRNAMES+= m32=../lib32
+ MULTILIB_MATCHES    := ${MULTILIB_MATCHES_ENDIAN}
+--- a/gcc/config/rs6000/t-linux64lebe
++++ b/gcc/config/rs6000/t-linux64lebe
+@@ -2,6 +2,6 @@
+ 
+ MULTILIB_OPTIONS    += mbig
+ MULTILIB_DIRNAMES   += be
+-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES))))))
+-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES)))
++MULTILIB_OSDIRNAMES := m64=../lib
++MULTILIB_OSDIRNAMES += m32=../lib32
+ MULTILIB_MATCHES    := ${MULTILIB_MATCHES_ENDIAN}

diff --git a/14.1.0/musl/50_all_cpu_indicator.patch b/14.1.0/musl/50_all_cpu_indicator.patch
new file mode 100644
index 0000000..52e8b92
--- /dev/null
+++ b/14.1.0/musl/50_all_cpu_indicator.patch
@@ -0,0 +1,37 @@
+https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612648.html
+
+From d16a8ceb1c3c8a7ec381090b4c316ff4c55661c0 Mon Sep 17 00:00:00 2001
+From:
+Date: Thu, 7 May 2020 21:14:11 -0500
+Subject: [PATCH] convert "__cpu_indicator_init" to
+ "__cpu_indicator_init_local"
+
+--- a/gcc/config/i386/i386-expand.cc
++++ b/gcc/config/i386/i386-expand.cc
+@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
+     {
+     case IX86_BUILTIN_CPU_INIT:
+       {
+-	/* Make it call __cpu_indicator_init in libgcc.  */
++	/* Make it call __cpu_indicator_init_local in libgcc.  */
+ 	tree call_expr, fndecl, type;
+ 	type = build_function_type_list (integer_type_node, NULL_TREE);
+-	fndecl = build_fn_decl ("__cpu_indicator_init", type);
++	fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
+ 	call_expr = build_call_expr (fndecl, 0);
+ 	return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
+       }
+
+--- a/libgcc/config/i386/cpuinfo.c
++++ b/libgcc/config/i386/cpuinfo.c
+@@ -508,7 +508,7 @@ __cpu_indicator_init (void)
+   return 0;
+ }
+ 
+-#if defined SHARED && defined USE_ELF_SYMVER
+-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
+-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
++#ifndef SHARED
++int __cpu_indicator_init_local (void)
++  __attribute__ ((weak, alias ("__cpu_indicator_init")));
+ #endif

diff --git a/14.1.0/musl/50_all_libssp_unconditionally.patch b/14.1.0/musl/50_all_libssp_unconditionally.patch
new file mode 100644
index 0000000..a3b5984
--- /dev/null
+++ b/14.1.0/musl/50_all_libssp_unconditionally.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/706210
+https://bugs.gentoo.org/747346
+
+Author: Timo Teräs <timo.teras@iki.fi>
+
+"Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
+as otherwise we get link failures if some objects are -fstack-protector built
+and final link happens with -fno-stack-protector. This seems to be the common
+case when bootstrapping gcc, the piepatches do not seem to fully fix the
+crosstoolchain and  bootstrap sequence wrt. stack-protector flag usage."
+
+(We do the same in Gentoo.)
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -870,8 +870,7 @@
+ 
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+-		       "|fstack-protector-strong|fstack-protector-explicit:}"
++#define LINK_SSP_SPEC "-lssp_nonshared"
+ #else
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+ 		       "|fstack-protector-strong|fstack-protector-explicit" \

diff --git a/14.1.0/musl/50_all_posix_memalign.patch b/14.1.0/musl/50_all_posix_memalign.patch
new file mode 100644
index 0000000..dd75a93
--- /dev/null
+++ b/14.1.0/musl/50_all_posix_memalign.patch
@@ -0,0 +1,28 @@
+--- a/gcc/config/i386/pmm_malloc.h
++++ b/gcc/config/i386/pmm_malloc.h
+@@ -27,12 +27,13 @@
+ #include <stdlib.h>
+ 
+ /* We can't depend on <stdlib.h> since the prototype of posix_memalign
+-   may not be visible.  */
++   may not be visible and we can't pollute the namespace either.  */
+ #ifndef __cplusplus
+-extern int posix_memalign (void **, size_t, size_t);
++extern int __gcc_posix_memalign (void **, size_t, size_t)
+ #else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
++extern "C" int __gcc_posix_memalign (void **, size_t, size_t) throw ()
+ #endif
++__asm__("posix_memalign");
+ 
+ static __inline void *
+ _mm_malloc (size_t __size, size_t __alignment)
+@@ -42,7 +43,7 @@
+     return malloc (__size);
+   if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
+     __alignment = sizeof (void *);
+-  if (posix_memalign (&__ptr, __alignment, __size) == 0)
++  if (__gcc_posix_memalign (&__ptr, __alignment, __size) == 0)
+     return __ptr;
+   else
+     return NULL;

diff --git a/14.1.0/musl/README.history b/14.1.0/musl/README.history
new file mode 100644
index 0000000..5d87ef9
--- /dev/null
+++ b/14.1.0/musl/README.history
@@ -0,0 +1,6 @@
+1       7 May 2024
+
+	+ 25_all_multilib_pure64.patch
+	+ 50_all_cpu_indicator.patch
+	+ 50_all_libssp_unconditionally.patch
+	+ 50_all_posix_memalign.patch


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/musl/
@ 2024-05-24  4:01 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-05-24  4:01 UTC (permalink / raw
  To: gentoo-commits

commit:     d9d0da50dd6c0967acf49cbfa82c664a915988c1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 04:01:10 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 24 04:01:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d9d0da50

14.1.0: musl: add more references/provenance to 50_all_cpu_indicator.patch

Thanks to awilfox for digging, but more on that in a minute.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 14.1.0/musl/50_all_cpu_indicator.patch | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/14.1.0/musl/50_all_cpu_indicator.patch b/14.1.0/musl/50_all_cpu_indicator.patch
index 52e8b92..ced7938 100644
--- a/14.1.0/musl/50_all_cpu_indicator.patch
+++ b/14.1.0/musl/50_all_cpu_indicator.patch
@@ -1,4 +1,6 @@
 https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612648.html
+https://gcc.gnu.org/legacy-ml/gcc-patches/2015-05/msg00899.html
+https://gcc.gnu.org/PR65612
 
 From d16a8ceb1c3c8a7ec381090b4c316ff4c55661c0 Mon Sep 17 00:00:00 2001
 From:


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/musl/
@ 2024-05-24  4:54 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-05-24  4:54 UTC (permalink / raw
  To: gentoo-commits

commit:     355bd9d6d5e9f924ee4520842f52e98fce958898
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 04:52:10 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 24 04:52:10 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=355bd9d6

14.1.0: musl: add context to 50_all_posix_memalign.patch

Thanks to awilfox.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 14.1.0/musl/50_all_posix_memalign.patch | 1 +
 1 file changed, 1 insertion(+)

diff --git a/14.1.0/musl/50_all_posix_memalign.patch b/14.1.0/musl/50_all_posix_memalign.patch
index dd75a93..1d9c586 100644
--- a/14.1.0/musl/50_all_posix_memalign.patch
+++ b/14.1.0/musl/50_all_posix_memalign.patch
@@ -1,3 +1,4 @@
+https://gcc.gnu.org/legacy-ml/gcc-patches/2015-05/msg01433.html
 --- a/gcc/config/i386/pmm_malloc.h
 +++ b/gcc/config/i386/pmm_malloc.h
 @@ -27,12 +27,13 @@


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/musl/
@ 2024-05-24  4:54 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-05-24  4:54 UTC (permalink / raw
  To: gentoo-commits

commit:     9a866462097fe24696c924a3874fd307c775e860
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 04:54:37 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 24 04:54:37 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9a866462

14.1.0: musl: update README.history

Signed-off-by: Sam James <sam <AT> gentoo.org>

 14.1.0/musl/README.history | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/14.1.0/musl/README.history b/14.1.0/musl/README.history
index 5d87ef9..a93d89b 100644
--- a/14.1.0/musl/README.history
+++ b/14.1.0/musl/README.history
@@ -1,3 +1,8 @@
+2	?? ??? 2024
+
+	- 50_all_cpu_indicator.patch
+	U 50_all_posix_memalign.patch
+
 1       7 May 2024
 
 	+ 25_all_multilib_pure64.patch


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/musl/
@ 2024-05-24  4:54 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-05-24  4:54 UTC (permalink / raw
  To: gentoo-commits

commit:     17e4c9c2c64242745ac0ed67f2b0ac394f22fe0a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 04:52:36 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 24 04:52:49 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=17e4c9c2

14.1.0: musl: drop 50_all_cpu_indicator.patch

Followup as I promised in d9d0da50dd6c0967acf49cbfa82c664a915988c1.

This patch was first added in ::musl in cabbb3a81cd2196cc4cc519a9ab165d8e0f08d0a [0].

It was fixed upstream in GCC in 9d8f95deca5b9a5ba63c638cf96f4678c68d2bd0 (r7-4472-g9d8f95deca5b9a)
and hence is long-obsolete.

Thanks again to awilfox.

[0] https://github.com/gentoo/musl/commit/cabbb3a81cd2196cc4cc519a9ab165d8e0f08d0a

Signed-off-by: Sam James <sam <AT> gentoo.org>

 14.1.0/musl/50_all_cpu_indicator.patch | 39 ----------------------------------
 1 file changed, 39 deletions(-)

diff --git a/14.1.0/musl/50_all_cpu_indicator.patch b/14.1.0/musl/50_all_cpu_indicator.patch
deleted file mode 100644
index ced7938..0000000
--- a/14.1.0/musl/50_all_cpu_indicator.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612648.html
-https://gcc.gnu.org/legacy-ml/gcc-patches/2015-05/msg00899.html
-https://gcc.gnu.org/PR65612
-
-From d16a8ceb1c3c8a7ec381090b4c316ff4c55661c0 Mon Sep 17 00:00:00 2001
-From:
-Date: Thu, 7 May 2020 21:14:11 -0500
-Subject: [PATCH] convert "__cpu_indicator_init" to
- "__cpu_indicator_init_local"
-
---- a/gcc/config/i386/i386-expand.cc
-+++ b/gcc/config/i386/i386-expand.cc
-@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
-     {
-     case IX86_BUILTIN_CPU_INIT:
-       {
--	/* Make it call __cpu_indicator_init in libgcc.  */
-+	/* Make it call __cpu_indicator_init_local in libgcc.  */
- 	tree call_expr, fndecl, type;
- 	type = build_function_type_list (integer_type_node, NULL_TREE);
--	fndecl = build_fn_decl ("__cpu_indicator_init", type);
-+	fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
- 	call_expr = build_call_expr (fndecl, 0);
- 	return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
-       }
-
---- a/libgcc/config/i386/cpuinfo.c
-+++ b/libgcc/config/i386/cpuinfo.c
-@@ -508,7 +508,7 @@ __cpu_indicator_init (void)
-   return 0;
- }
- 
--#if defined SHARED && defined USE_ELF_SYMVER
--__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
--__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
-+#ifndef SHARED
-+int __cpu_indicator_init_local (void)
-+  __attribute__ ((weak, alias ("__cpu_indicator_init")));
- #endif


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-24  4:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24  4:54 [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/musl/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-05-24  4:54 Sam James
2024-05-24  4:54 Sam James
2024-05-24  4:01 Sam James
2024-05-24  4:01 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox