commit: 88c38d6560ed4c2fd2647370e4464cff617e7e43 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Dec 13 10:58:10 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Dec 13 10:58:33 2024 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=88c38d65
14.2.0: add missing musl dir Signed-off-by: Sam James <sam <AT> gentoo.org> 14.2.0/musl/25_all_multilib_pure64.patch | 83 +++++++++++++++++++++++++ 14.2.0/musl/50_all_libssp_unconditionally.patch | 24 +++++++ 14.2.0/musl/50_all_posix_memalign.patch | 29 +++++++++ 14.2.0/musl/README.history | 11 ++++ 4 files changed, 147 insertions(+) diff --git a/14.2.0/musl/25_all_multilib_pure64.patch b/14.2.0/musl/25_all_multilib_pure64.patch new file mode 100644 index 0000000..d55c04c --- /dev/null +++ b/14.2.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.2.0/musl/50_all_libssp_unconditionally.patch b/14.2.0/musl/50_all_libssp_unconditionally.patch new file mode 100644 index 0000000..a3b5984 --- /dev/null +++ b/14.2.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.te...@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.2.0/musl/50_all_posix_memalign.patch b/14.2.0/musl/50_all_posix_memalign.patch new file mode 100644 index 0000000..1d9c586 --- /dev/null +++ b/14.2.0/musl/50_all_posix_memalign.patch @@ -0,0 +1,29 @@ +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 @@ + #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.2.0/musl/README.history b/14.2.0/musl/README.history new file mode 100644 index 0000000..a93d89b --- /dev/null +++ b/14.2.0/musl/README.history @@ -0,0 +1,11 @@ +2 ?? ??? 2024 + + - 50_all_cpu_indicator.patch + U 50_all_posix_memalign.patch + +1 7 May 2024 + + + 25_all_multilib_pure64.patch + + 50_all_cpu_indicator.patch + + 50_all_libssp_unconditionally.patch + + 50_all_posix_memalign.patch