From 7a7eaddd69c42a160fd4a47f4d3829708409cd64 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 25 Dec 2020 14:58:38 +0100 Subject: [PATCH] gcc: use consistent patch level for musl patches needed for cross build style --- srcpkgs/gcc/files/libgnarl-musl.patch | 8 ++++---- srcpkgs/gcc/files/libssp-musl.patch | 12 ++++++------ srcpkgs/gcc/template | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/srcpkgs/gcc/files/libgnarl-musl.patch b/srcpkgs/gcc/files/libgnarl-musl.patch index 31d39607ea..5ed9f16f55 100644 --- a/srcpkgs/gcc/files/libgnarl-musl.patch +++ b/srcpkgs/gcc/files/libgnarl-musl.patch @@ -3,8 +3,8 @@ Upstream: Unknown Reason: Patch libgnarl to not use function missing from musl. diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads ---- gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800 -+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700 +--- gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800 ++++ gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700 @@ -394,12 +394,6 @@ package System.OS_Interface is PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; @@ -31,8 +31,8 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l sched_priority : int; -- scheduling priority end record; diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb ---- gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800 -+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800 +--- gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800 ++++ gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800 @@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper pragma Import (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch index 8a692c0d66..8d47b442aa 100644 --- a/srcpkgs/gcc/files/libssp-musl.patch +++ b/srcpkgs/gcc/files/libssp-musl.patch @@ -2,8 +2,8 @@ First part taken from Alpine. Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. ---- a/gcc/gcc.c -+++ b/gcc/gcc.c +--- gcc/gcc.c ++++ gcc/gcc.c @@ -876,9 +876,8 @@ #endif @@ -15,8 +15,8 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ ---- a/gcc/config/i386/gnu-user-common.h -+++ b/gcc/config/i386/gnu-user-common.h +--- gcc/config/i386/gnu-user-common.h ++++ gcc/config/i386/gnu-user-common.h @@ -64,9 +64,3 @@ along with GCC; see the file COPYING3. If not see /* Static stack checking is supported by means of probes. */ @@ -27,8 +27,8 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. -#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE -#define TARGET_CAN_SPLIT_STACK -#endif ---- a/gcc/config/i386/gnu.h -+++ b/gcc/config/i386/gnu.h +--- gcc/config/i386/gnu.h ++++ gcc/config/i386/gnu.h @@ -40,11 +40,6 @@ along with GCC. If not, see . /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ #define TARGET_THREAD_SSP_OFFSET 0x14 diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template index 472b952eae..02a7516002 100644 --- a/srcpkgs/gcc/template +++ b/srcpkgs/gcc/template @@ -173,8 +173,8 @@ pre_configure() { sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure case "$XBPS_TARGET_MACHINE" in *-musl) - patch -p1 -i ${FILESDIR}/libgnarl-musl.patch - patch -p1 -i ${FILESDIR}/libssp-musl.patch + patch -p0 -i ${FILESDIR}/libgnarl-musl.patch + patch -p0 -i ${FILESDIR}/libssp-musl.patch patch -p0 -i ${FILESDIR}/gccgo-musl.patch ;; esac