cross/gcc-*: upgrade to 11.2.1_git20220219

This commit is contained in:
Minecrell 2022-02-21 17:53:02 +01:00
parent 676b6c20bf
commit af08a81fcd
159 changed files with 2349 additions and 771 deletions

View file

@ -1,4 +1,4 @@
From e289226f5f16db14ca549efb41ca82accfe7ea8a Mon Sep 17 00:00:00 2001
From feb04e50d907683385cc4dc0163cf1d82258073a Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
@ -38,5 +38,5 @@ index 1b0bfe37852..d7b2b19bb3c 100644
else
return NULL;
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 48be81c9accb55c3c5ee683c84fa1f908bb18764 Mon Sep 17 00:00:00 2001
From d64825212f807435a4b2f8e068c0f65195c8e2e6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH] gcc: poison-system-directories
@ -120,7 +120,7 @@ index df1c9cc3200..5461bab88a9 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5a4b3c6c234..9d1126e9751 100644
index cf536a15116..7d3f1ccddf3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
@ -131,7 +131,7 @@ index 5a4b3c6c234..9d1126e9751 100644
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -7727,6 +7728,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -7728,6 +7729,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
@ -199,5 +199,5 @@ index 446d280321d..fbfc0ce03b8 100644
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 767b97ca271e82601a435015190fd15bfb28ae12 Mon Sep 17 00:00:00 2001
From 9675297b3a46b65a54e9df97f26ea445d53c67c6 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
@ -14,10 +14,10 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9d1126e9751..4b8335bbd1f 100644
index 7d3f1ccddf3..485d2d6b742 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15920,6 +15920,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -15921,6 +15921,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
@ -40,5 +40,5 @@ index a83ba34ac4b..faf9ce76b3d 100644
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From b8abbd503d1be992bf1d204f0e6de5260fcdf533 Mon Sep 17 00:00:00 2001
From 4eb1b3849325b77c4cb66b675119299de35125bb Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 9f993c4aff2..7db314195ff 100644
index 11e015bdb87..de8b7bf246f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1421,6 +1421,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1427,6 +1427,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
@ -25,10 +25,10 @@ index 9f993c4aff2..7db314195ff 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4b8335bbd1f..833164e0a2b 100644
index 485d2d6b742..164929f7583 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10224,6 +10224,12 @@ also turns on the following optimization flags:
@@ -10225,6 +10225,12 @@ also turns on the following optimization flags:
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
@ -42,5 +42,5 @@ index 4b8335bbd1f..833164e0a2b 100644
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 1837896f54bd318788c1ba6dbd19c3efe147ba20 Mon Sep 17 00:00:00 2001
From 8de5d46c530ceca9f4add46d5cae3cd52c38eba3 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
@ -268,5 +268,5 @@ index faf9ce76b3d..1ad5da6d769 100644
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 1ba693868db68bef5178fd797c9e7d2cc4128182 Mon Sep 17 00:00:00 2001
From 85e12e3d32a44c3fd10b5327edd542972a179eec Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
@ -30,5 +30,5 @@ index 2005b783c68..c5c6af427cc 100644
Wformat-overflow=
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From eb2f1f7d7c503959279a7317af7b9a7625eecc6e Mon Sep 17 00:00:00 2001
From f1e92f5f3576779776c9f3d6aeef76e1569e719a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.
@ -21,5 +21,5 @@ index d15105a73f3..29f9504cb68 100644
Wtype-limits
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 7a4086e83e3abbf2c20b7211e2a2c0bf00f25ff8 Mon Sep 17 00:00:00 2001
From 3503fd734a33b67ec6a9fdc2c52bb8310864b119 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
@ -49,5 +49,5 @@ index 8ba281b4cfa..bab39cdf8a2 100644
-param=stack-clash-protection-guard-size=
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 1c38cbf1f75066c3acc145f449f1fbd0b5de7968 Mon Sep 17 00:00:00 2001
From c4dd51fe15a938fdd76d781a4eede2a9205eacbc Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
@ -50,5 +50,5 @@ index 8edd2e05639..63f61fcf96f 100644
all-local: all-local-$(USE_NLS)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From e4c844ce0c1c355c2d1cf6a6e1595030b8ce2a5e Mon Sep 17 00:00:00 2001
From 0a1fd78184f00fb77dac00dabe98eb025620efc2 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH] Don't declare asprintf if defined as a macro.
@ -24,5 +24,5 @@ index f4c0fe11d6f..cf4b1043e4d 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 79309ae34db26104ec85f6af31a4a8133142fe6d Mon Sep 17 00:00:00 2001
From f81d67f6fe1f1066642606209c882b333d937cb7 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH] libiberty: copy PIC objects during build process
@ -20,5 +20,5 @@ index 4f1213b983b..d0224649d30 100644
else true; fi
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From fdf5ef3d1e61625cb96647d5bdc4ca0a32d287ec Mon Sep 17 00:00:00 2001
From 3b732288ce771348cbcc9fb633a36b7aff2b4ad4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:36 +0000
Subject: [PATCH] libitm: disable FORTIFY
@ -29,5 +29,5 @@ index a3d84896cc5..ecb281d5919 100644
# work out any special compilation flags as necessary.
case "${target_cpu}" in
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 9442d683845f63b931374ff81a7d08a31f992135 Mon Sep 17 00:00:00 2001
From a3e556187d0a8e9d39544f023960eca0f07d3e83 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH] libgcc_s
@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 16765718cc3..4a855b791b9 100644
index 1772fb16c9a..77e04b0c2df 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -11063,10 +11063,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
@@ -11066,10 +11066,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@ -53,5 +53,5 @@ index 8506a635790..564296f788e 100644
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 7a3e354de1ab87e992bfdaf858677ca140b80732 Mon Sep 17 00:00:00 2001
From f520e67fba621f213146271408ff3210b3527176 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH] nopie
@ -71,5 +71,5 @@ index 5461bab88a9..1577529ffb7 100644
AC_SUBST([NO_PIE_FLAG])
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 9a5417a787c2ba197c0a3002ea7423488bedab0a Mon Sep 17 00:00:00 2001
From 37310cabb8bc7256899c4d45cc68a47ca2a3232b Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:57:09 +0000
Subject: [PATCH] libffi: use __linux__ instead of __gnu_linux__ for musl
@ -21,5 +21,5 @@ index 721ff00ea43..22a699c6340 100644
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From ecc537cc597fba87f00d3128fddd5f2a17e7d222 Mon Sep 17 00:00:00 2001
From 586e82425a024d85d1bd9952ca51d8a671aa9b5d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:57:51 +0000
Subject: [PATCH] dlang: update zlib binding
@ -421,5 +421,5 @@ index e6cce240fd5..bd2fe37ebec 100644
}
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 273edfbf9845a349cec0643c23fff5a740c76f78 Mon Sep 17 00:00:00 2001
From 26daa73d678b87a6950df1d79d171ba40ecbce15 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:18:32 +0000
Subject: [PATCH] dlang: use libucontext on mips64
@ -20,5 +20,5 @@ index 0643daeb613..b74d9fb3f25 100644
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 602c9c669e8270f51b8c9c07c3b8840d3cc5d5e4 Mon Sep 17 00:00:00 2001
From caeae8288593dbd5a1a6d93508d875eb0d8fdf49 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:19:12 +0000
Subject: [PATCH] dlang: libdruntime: define fcntl.h constants for mips64
@ -34,5 +34,5 @@ index 59df921ba41..9ee9f943948 100644
static assert(0, "Platform not supported");
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 94f4f85904f1c042e4d0c0ac855143129d58fdbd Mon Sep 17 00:00:00 2001
From 374a19de60fcd5c31321c3f4d26dcc4b631e8c3f Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH] ada: fix shared linking
@ -38,5 +38,5 @@ index 5cd5ef64f56..1c611a82cab 100644
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From dac504eb0d50d751ac558efaf84d37716e9ee05b Mon Sep 17 00:00:00 2001
From ad053bc46b535e78397f992e3c2c1d28c1ebd1f4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
@ -20,5 +20,5 @@ index 047be0255e2..426949aa91c 100644
# This is the list of directories to built for the host system.
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 5cc67e1262c1641aefa6da1e31bc759ecd1becbd Mon Sep 17 00:00:00 2001
From 18d44a7f8d801cc6926a73e2dda2f0ce859dc561 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths
@ -21,5 +21,5 @@ index 4e1db60fced..7fcf402b416 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 154f797756e8098f33fa16799749b4cd827dd81c Mon Sep 17 00:00:00 2001
From 38d27ebdcc5a8bea0807b5d56203f0ea5e16868f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Aug 2020 07:03:00 +0000
Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
@ -27,5 +27,5 @@ index 99314032ec2..6e91767efe8 100644
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From a025b2325486bcba0cdf82a0468013961fe7cb99 Mon Sep 17 00:00:00 2001
From 0cc2a1befaf343e5ce1cbc15bd247eee812bdf33 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
@ -65,5 +65,5 @@ index 6e91767efe8..22dbbf85850 100644
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From da8359d60789065ad866b0d5e3efa03d69829851 Mon Sep 17 00:00:00 2001
From feea6f782e83a53487ad633608484dfa3483be1b Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] mips64: disable multilib support
@ -44,5 +44,5 @@ index 130e1f04707..a64ac2bbb5b 100644
+ ../lib32 \
+ ../lib
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 56a29e6c843999581b043b9a826853f90a2fd1e8 Mon Sep 17 00:00:00 2001
From cbd96a32dc2aaa61f6adcb3643e1da21f185f80e Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:12:55 +0000
Subject: [PATCH] aarch64: disable multilib support
@ -22,5 +22,5 @@ index 241b0ef20b6..18e63b34d8b 100644
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 2886563232a0c829e29a4a8d0e1d83392e134aef Mon Sep 17 00:00:00 2001
From e87e415e9a88dbce68ed7b9d8386c3c2d0c0d6b6 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:13:59 +0000
Subject: [PATCH] s390x: disable multilib support
@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 88e39c0c4bc64a5734fdd6f255b62fd8711d73bb Mon Sep 17 00:00:00 2001
From 5c24869c9bc1a552f8bb5c32a8538c6e065a4db8 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:33 +0000
Subject: [PATCH] ppc64[le]: disable multilib support
@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 2df8f5e7bfe077f5bdb1506d971644c471af4a06 Mon Sep 17 00:00:00 2001
From 25927f8106583ee594e7bcdf92dd1387e0fd024c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:54 +0000
Subject: [PATCH] x86_64: disable multilib support
@ -22,5 +22,5 @@ index d288b093522..2949033aa04 100644
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From f45e75200cdebab7c23960d3ccebec862e269557 Mon Sep 17 00:00:00 2001
From 18bcf23cae4069ffe9d9f64e851193d29dd4814f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 3 Jan 2022 07:14:48 +0100
Subject: [PATCH] riscv: disable multilib support
@ -70,5 +70,5 @@ index 216d2776a18..1a8a863853e 100644
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 97972b0c9ef7b7f6b7ca87e2bbae6cb4e3adff51 Mon Sep 17 00:00:00 2001
From a46c8d6cb9428db29fbf8a80609ff449354ce111 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:05:41 +0000
Subject: [PATCH] always build libgcc_eh.a
@ -47,5 +47,5 @@ index 2c8be561eb5..c557750b1b3 100644
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 62e3ecf4d1216fb0daf9b12db3f4310170a80f8f Mon Sep 17 00:00:00 2001
From d7064ab25a561bb99c3d0b35663154656013aed2 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:06:30 +0000
Subject: [PATCH] ada: libgnarl compatibility for musl
@ -131,5 +131,5 @@ index 757a6cdfdad..82df94f6a00 100644
pragma Assert (Result in 0 | ENOMEM);
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From a259508e9e3eb1dd5ebd160ac4600cb948d850fc Mon Sep 17 00:00:00 2001
From 5193de0a6c96fefe0c46fc9a6b8c27623ad85640 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH] ada: musl support fixes
@ -11,7 +11,7 @@ Subject: [PATCH] ada: musl support fixes
4 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 987eff0abba..03c8bc6f496 100644
index b5b8b573ea4..6fce40d1e98 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1748,7 +1748,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@ -50,7 +50,7 @@ index 987eff0abba..03c8bc6f496 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2699,7 +2699,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2700,7 +2700,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -219,5 +219,5 @@ index ec9db3a6a4c..6f92e50dd67 100644
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From eec75a34ecc5074ed5857a8a2964d5a1e8fe5a66 Mon Sep 17 00:00:00 2001
From 8a42d93247c375f199f3079538d659f95b9ff2a0 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 30 Aug 2020 17:59:45 +0200
Subject: [PATCH] gcc-go: Fix handling of signal 34 on musl
@ -39,5 +39,5 @@ index 11e4ec436bd..fe866eacb27 100644
if test "${GOOS}" = "aix"; then
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From dfd96cebf29a04f8a89587deb7469274cd206382 Mon Sep 17 00:00:00 2001
From c205f79c18add13247a06cfd843f5eb44c4c3cb4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 25 Nov 2021 01:47:03 +0000
Subject: [PATCH] There are more than one st_{a,m,c}tim fields in struct stat
@ -23,5 +23,5 @@ index 0c52ea5d71a..6fef104cc1c 100755
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 54aca66b0640f56b7b0473ebd08ec8e9c8edb78e Mon Sep 17 00:00:00 2001
From af64f915a4717036a7f1fe637308b455c94e0f1e Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 30 Aug 2020 18:03:03 +0200
Subject: [PATCH] gcc-go: signal 34 is special on musl libc
@ -25,5 +25,5 @@ index 2eece687e35..e86490ce203 100644
}
throw("sigaction read failure")
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From c61dfe08fa888a93fd1d65484a79dc4dd4260c03 Mon Sep 17 00:00:00 2001
From 6e41b6753af412388e9259fe791904146695e84e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 30 Aug 2020 19:27:51 +0200
Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c
@ -23,5 +23,5 @@ index 38bf7a6b255..e50403b5a75 100644
static inline void
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 9e7be29ad618d48740f42c98ba93e8367341b63f Mon Sep 17 00:00:00 2001
From cc89c078ffc58a7f6675a60fbca24224effcb7e3 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Mon, 31 Aug 2020 08:59:40 +0200
Subject: [PATCH] gcc-go: link to libucontext
@ -21,5 +21,5 @@ index 426949aa91c..f97db1ef569 100644
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From f9defb064cdd5565d308df5d61f6881ea601e276 Mon Sep 17 00:00:00 2001
From 3fb914ca83ac18287ee24aa75aba9149e35487ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 19 Apr 2021 07:21:41 +0200
Subject: [PATCH] Use generic errstr.go implementation on musl
@ -44,5 +44,5 @@ index 5b19e6f202d..8dc60172186 100644
package syscall
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From c25b1e409bd20c7a1c47063e36c75f0dcca0b410 Mon Sep 17 00:00:00 2001
From 52ce9c86c0c89ae45e0d08cc232682e1811aa8f2 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
@ -271,5 +271,5 @@ index 22dbbf85850..90aa576037a 100644
#ifdef ENABLE_DEFAULT_SSP
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 0282e9fc31d4245f0c562ac42fa7c900363c2c12 Mon Sep 17 00:00:00 2001
From 5010fa237897bca92291ba8835123125d4af933a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 29 Aug 2021 09:45:27 +0200
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
@ -53,5 +53,5 @@ index 670b0d72cfe..38c2cd9345f 100644
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From eab088e3a76ce23cf2365351c59707e2dd0aa599 Mon Sep 17 00:00:00 2001
From 2d924c522dde7426afbb8096d9301b17d0e73121 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 28 Nov 2021 00:54:37 +0100
Subject: [PATCH] libgo: Recognize off64_t and loff_t definitions of musl libc
@ -80,5 +80,5 @@ index 8ce061e2f5f..b85add15a7b 100644
// be signed in some OSes.
#ifdef SIOCGIFMTU
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From cad142fc0fa5fa52c886ad8807cc62b34e5f1540 Mon Sep 17 00:00:00 2001
From 72f32e3383129ad139df76d9a063fac9b03079b1 Mon Sep 17 00:00:00 2001
From: Alex McGrath <amk@amk.ie>
Date: Wed, 13 Oct 2021 23:24:27 +0100
Subject: [PATCH] Fix attempt to use poisoned calloc error in libgccjit
@ -76,5 +76,5 @@ index 0cc650f9810..2f44481eeb0 100644
#include "libgccjit.h"
#include "jit-recording.h"
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 4ede09cec9f5df24d0d24e7d82b07a9a0ffccdda Mon Sep 17 00:00:00 2001
From aeef0ee2aac43d89ae26c6a3559aae4f8a1d53da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Thu, 25 Nov 2021 17:44:04 +0100
Subject: [PATCH] stddef.h: add support for musl typedef macro guards
@ -102,5 +102,5 @@ index 66619fe43b1..50d710a5ab9 100644
#endif /* _BSD_RUNE_T_DEFINED_ */
#endif
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 61fc6a52f3fc5fe6c66dc2dd0fa222ba1349d7e5 Mon Sep 17 00:00:00 2001
From 36c79820c1085590f272ef1afcad4744125d96d0 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 30 Aug 2020 18:33:49 +0200
Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap
@ -59,5 +59,5 @@ index fa3389d857e..57bed97c710 100644
if uintptr(p) == _MAP_FAILED {
return nil, errno()
--
2.34.1
2.35.1

View file

@ -1,98 +0,0 @@
From 30e4c9be8d17c7806beaca9e78f6aff6ebae6463 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Wed, 15 Dec 2021 00:14:19 +0100
Subject: [PATCH] Disable -fsplit-stack support on non-glibc targets
The -fsplit-stack option requires the pthread_t TCB definition in the
libc to provide certain struct fields at specific hardcoded offsets. As
far as I know, only glibc provides these fields at the required offsets.
Most notably, musl libc does not have these fields. However, since gcc
accesses the fields using a fixed offset this does not cause a
compile-time error but instead results in a silent memory corruption at
run-time. For example, on s390x libgcc's __stack_split_initialize CTOR
will overwrite the cancel field in the pthread_t TCB on musl.
The -fsplit-stack option is used within the gcc code base by gcc-go by
default. On musl based systems with split-stack support (e.g. s390x or
x86) this causes Go programs compiled with gcc-go to misbehave at
run-time.
This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
since it is not supported on non-glibc targets anyhow. This is achieved
by checking if TARGET_GLIBC_MAJOR is defined to a non-zero value (it
defaults to zero on non-glibc systems). The check has been added for x86
and s390x, the rs6000 config already checks for TARGET_GLIBC_MAJOR. With
this patch applied, the gcc-go configure script will detect that
-fsplit-stack support is not available and will not use it.
This patch has been tested on Alpine Linux Edge on the s390x
architecture by bootstrapping Google's Go implementation with gcc-go.
See https://www.openwall.com/lists/musl/2012/10/16/12
---
gcc/common/config/s390/s390-common.c | 9 ++++++++-
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 6 +++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index b6bc8501742..afbd8d3fe66 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -116,13 +116,20 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
/* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
We don't verify it, since earlier versions just have padding at
- its place, which works just as well. */
+ its place, which works just as well. For other libc implementations
+ we disable the feature entirely to avoid corrupting the TCB. */
static bool
s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
struct gcc_options *opts ATTRIBUTE_UNUSED)
{
+#if TARGET_GLIBC_MAJOR
return true;
+#else
+ if (report)
+ error("%<-fsplit-stack%> currently only supported on GNU/Linux");
+ return false;
+#endif
}
#undef TARGET_DEFAULT_TARGET_FLAGS
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 00226f5a455..554e146dbbe 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives and
+ uses glibc. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && TARGET_GLIBC_MAJOR
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 25fbc07f58c..895a7369816 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -35,7 +35,11 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-#ifdef TARGET_LIBC_PROVIDES_SSP
+/* -fsplit-stack uses a field in the TCB at a fixed offset. This
+ field is only available for glibc. Disable -fsplit-stack for
+ other libc implementation to avoid silent TCB corruptions. */
+
+#if defined (TARGET_LIBC_PROVIDES_SSP) && TARGET_GLIBC_MAJOR
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
--
2.34.1

View file

@ -1,4 +1,4 @@
From c1408c2e323bf724db3bb8b1523e4cf5848c7e63 Mon Sep 17 00:00:00 2001
From 353c8abdc34a294c89c24423ef0c4182189117f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
Date: Sun, 2 Jan 2022 01:07:03 +0100
Subject: [PATCH] libgo: include asm/ptrace.h for pt_regs definition on PowerPC
@ -54,5 +54,5 @@ index d30d1603adc..fc01e04e4a1 100644
#ifndef SA_RESTART
--
2.34.1
2.35.1

View file

@ -0,0 +1,115 @@
From 2c6bf28619c9b3bf713f7f5319c5d750a6c297ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
Date: Fri, 21 Jan 2022 19:22:46 +0000
Subject: [PATCH] Disable -fsplit-stack support on non-glibc targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The -fsplit-stack option requires the pthread_t TCB definition in the
libc to provide certain struct fields at specific hardcoded offsets. As
far as I know, only glibc provides these fields at the required offsets.
Most notably, musl libc does not have these fields. However, since gcc
accesses the fields using a fixed offset, this does not cause a
compile-time error, but instead results in a silent memory corruption at
run-time with musl libc. For example, on s390x libgcc's
__stack_split_initialize CTOR will overwrite the cancel field in the
pthread_t TCB on musl.
The -fsplit-stack option is used within the gcc code base itself by
gcc-go (if available). On musl-based systems with split-stack support
(i.e. s390x or x86) this causes Go programs compiled with gcc-go to
misbehave at run-time.
This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
since it is not supported on non-glibc targets anyhow. This is achieved
by checking if gcc targets a glibc-based system. This check has been
added for x86 and s390x, the rs6000 config already checks for
TARGET_GLIBC_MAJOR. Other architectures do not have split-stack
support. With this patch applied, the gcc-go configure script will
detect that -fsplit-stack support is not available and will not use it.
See https://www.openwall.com/lists/musl/2012/10/16/12
This patch was written under the assumption that glibc is the only libc
implementation which supports the required fields at the required
offsets in the pthread_t TCB. The patch has been tested on Alpine Linux
Edge on the s390x and x86 architectures by bootstrapping Google's Go
implementation with gcc-go.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
gcc/ChangeLog:
* common/config/s390/s390-common.c (s390_supports_split_stack):
Only support split-stack on glibc targets.
* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN): Ditto.
* config/i386/gnu.h (defined): Ditto.
---
gcc/common/config/s390/s390-common.c | 14 ++++++++++----
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 5 ++++-
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index b6bc8501742..8c1e590322d 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -116,13 +116,19 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
/* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
We don't verify it, since earlier versions just have padding at
- its place, which works just as well. */
+ its place, which works just as well. For other libc implementations
+ we disable the feature entirely to avoid corrupting the TCB. */
static bool
-s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
- struct gcc_options *opts ATTRIBUTE_UNUSED)
+s390_supports_split_stack (bool report,
+ struct gcc_options *opts)
{
- return true;
+ if (opts->x_linux_libc == LIBC_GLIBC)
+ return true;
+
+ if (report)
+ error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
+ return false;
}
#undef TARGET_DEFAULT_TARGET_FLAGS
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 00226f5a455..6e13315b5a3 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives and
+ targets glibc. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 25fbc07f58c..afd3e8e8841 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -35,7 +35,10 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-#ifdef TARGET_LIBC_PROVIDES_SSP
+/* -fsplit-stack uses a field in the TCB at a fixed offset. This
+ field is only available for glibc. Disable -fsplit-stack for
+ other libc implementations to avoid silent TCB corruptions. */
+#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
--
2.35.1

View file

@ -0,0 +1,94 @@
From 4ea687132408a7c662706c4a7eb3c61b7773d735 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 21 Jan 2022 13:24:00 -0800
Subject: [PATCH] x86: Properly disable -fsplit-stack support on non-glibc
targets
Revert x86 changes in
commit c163647ffbc9a20c8feb6e079dbecccfe016c82e
Author: Soren Tempel <soeren@soeren-tempel.net>
Date: Fri Jan 21 19:22:46 2022 +0000
Disable -fsplit-stack support on non-glibc targets
and change ix86_supports_split_stack to return true only on glibc.
PR bootstrap/104170
* common/config/i386/i386-common.c (ix86_supports_split_stack):
Return true only on glibc.
* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN):
Revert commit c163647ffbc.
* config/i386/gnu.h (TARGET_LIBC_PROVIDES_SSP): Likewise.
---
gcc/common/config/i386/i386-common.c | 17 +++++++++++------
gcc/config/i386/gnu-user-common.h | 5 ++---
gcc/config/i386/gnu.h | 5 +----
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index 96549aa7d7e..a3b5258e828 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -1696,16 +1696,21 @@ ix86_option_init_struct (struct gcc_options *opts)
field in the TCB, so they cannot be used together. */
static bool
-ix86_supports_split_stack (bool report ATTRIBUTE_UNUSED,
+ix86_supports_split_stack (bool report,
struct gcc_options *opts ATTRIBUTE_UNUSED)
{
+#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
+ if (opts->x_linux_libc != LIBC_GLIBC)
+#endif
+ {
+ if (report)
+ error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
+ return false;
+ }
+
bool ret = true;
-#ifndef TARGET_THREAD_SPLIT_STACK_OFFSET
- if (report)
- error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
- ret = false;
-#else
+#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
{
if (report)
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 6e13315b5a3..00226f5a455 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,8 +66,7 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives and
- targets glibc. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
+ assembler has full support for the CFI directives. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index afd3e8e8841..25fbc07f58c 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -35,10 +35,7 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-/* -fsplit-stack uses a field in the TCB at a fixed offset. This
- field is only available for glibc. Disable -fsplit-stack for
- other libc implementations to avoid silent TCB corruptions. */
-#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
+#ifdef TARGET_LIBC_PROVIDES_SSP
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
--
2.35.1

View file

@ -1,9 +1,8 @@
From 7b7f146c0dd01fde892ed5b5f40850bdacd7431b Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
From e74e2946a534fbac7e8ec6c687c407761daef49a Mon Sep 17 00:00:00 2001
From: Mathias LANG <pro.mathias.lang@gmail.com>
Date: Mon, 17 Jan 2022 16:31:09 +0000
Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext
from: Mathias LANG <pro.mathias.lang@gmail.com>
ref: alpine/aports#13422
---
Makefile.in | 2 +-
@ -23,5 +22,5 @@ index 7e577ed3dbb..da40b61a8c5 100644
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.34.1
2.35.1

View file

@ -0,0 +1,298 @@
From 7b5108375bb67532af30d1e7f553ac5f3b1096fe Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@redhat.com>
Date: Mon, 24 Jan 2022 11:13:39 +0100
Subject: [PATCH] properly disable -fsplit-stack on non-glibc targets
[PR104170]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On Sat, Jan 22, 2022 at 10:32:21AM +0100, Martin Liška wrote:
> I've just noticed the patch broke a few cross compilers:
>
> s390x-ibm-tpf:
>
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/s390/s390-common.cc: In function bool s390_supports_split_stack(bool, gcc_options*):
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/s390/s390-common.cc:126:13: error: struct gcc_options has no member named x_linux_libc
> 126 | if (opts->x_linux_libc == LIBC_GLIBC)
> | ^~~~~~~~~~~~
>
> i686-kopensolaris-gnu, i686-symbolics-gnu
>
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/i386/i386-common.cc: In function bool ix86_supports_split_stack(bool, gcc_options*):
> /home/marxin/buildworker/zen2-cross-compilers/build/gcc/common/config/i386/i386-common.cc:1721:13: error: struct gcc_options has no member named x_linux_libc
> 1721 | if (opts->x_linux_libc != LIBC_GLIBC)
> | ^~~~~~~~~~~~
> make[1]: *** [Makefile:2418: i386-common.o] Error 1
>
> Can you please take a look? Btw. do you have a bugzilla account?
I bet instead of opts->x_linux_libc != LIBC_GLIBC it needs to use
#ifdef OPTION_GLIBC
if (!OPTION_GLIBC)
#endif
or so. I think the first committed patch actually used that
but used it in #if directive, which is wrong because it is something
that needs to be evaluated at runtime.
That doesn't work well either, because the *supports_split_stack
hooks have opts argument and OPTION_GLIBC doesn't take that.
So, here is a patch that introduces OPTION_*_P macros that take opts
as an argument and redefines OPTION_* using those (similarly to how
the option scripts create TARGET_*_P and TARGET_* macros).
2022-01-24 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/104170
* config/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
using OPTION_*_P macros.
* config/alpha/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
using OPTION_*_P macros.
* config/rs6000/linux.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
using OPTION_*_P macros.
* config/rs6000/linux64.h (OPTION_GLIBC_P, OPTION_UCLIBC_P,
OPTION_BIONIC_P, OPTION_MUSL_P): Define.
(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC, OPTION_MUSL): Redefine
using OPTION_*_P macros.
* config/fuchsia.h (OPTION_MUSL_P): Redefine.
* config/glibc-stdint.h (OPTION_MUSL_P): Define if not defined.
* common/config/s390/s390-common.cc (s390_supports_split_stack): Re-add
ATTRIBUTE_UNUSED to opts parameter. If OPTION_GLIBC_P is defined, use
OPTION_GLIBC_P (opts) as condition, otherwise assume if (false).
* common/config/i386/i386-common.cc (ix86_supports_split_stack): If
OPTION_GLIBC_P is defined use !OPTION_GLIBC_P (opts) as condition,
otherwise assume if (true).
---
gcc/common/config/i386/i386-common.c | 4 ++--
gcc/common/config/s390/s390-common.c | 6 ++++--
gcc/config/alpha/linux.h | 25 +++++++++++++++----------
gcc/config/fuchsia.h | 2 ++
gcc/config/glibc-stdint.h | 3 +++
gcc/config/linux.h | 25 +++++++++++++++----------
gcc/config/rs6000/linux.h | 25 +++++++++++++++----------
gcc/config/rs6000/linux64.h | 25 +++++++++++++++----------
8 files changed, 71 insertions(+), 44 deletions(-)
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index a3b5258e828..864e68ab985 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -1699,8 +1699,8 @@ static bool
ix86_supports_split_stack (bool report,
struct gcc_options *opts ATTRIBUTE_UNUSED)
{
-#ifdef TARGET_THREAD_SPLIT_STACK_OFFSET
- if (opts->x_linux_libc != LIBC_GLIBC)
+#if defined(TARGET_THREAD_SPLIT_STACK_OFFSET) && defined(OPTION_GLIBC_P)
+ if (!OPTION_GLIBC_P (opts))
#endif
{
if (report)
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index 8c1e590322d..11116f131cb 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -121,10 +121,12 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
static bool
s390_supports_split_stack (bool report,
- struct gcc_options *opts)
+ struct gcc_options *opts ATTRIBUTE_UNUSED)
{
- if (opts->x_linux_libc == LIBC_GLIBC)
+#ifdef OPTION_GLIBC_P
+ if (OPTION_GLIBC_P (opts))
return true;
+#endif
if (report)
error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index bde7fb0d292..812ec8ecb31 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -58,18 +58,23 @@ along with GCC; see the file COPYING3. If not see
#define WCHAR_TYPE "int"
#ifdef SINGLE_LIBC
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
#else
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
#endif
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
+#undef OPTION_MUSL
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
/* Determine what functions are present at the runtime;
this includes full c99 runtime and sincos. */
diff --git a/gcc/config/fuchsia.h b/gcc/config/fuchsia.h
index 54602dc300d..47c0dfd8b81 100644
--- a/gcc/config/fuchsia.h
+++ b/gcc/config/fuchsia.h
@@ -52,6 +52,8 @@ along with GCC; see the file COPYING3. If not see
/* We are using MUSL as our libc. */
#undef OPTION_MUSL
#define OPTION_MUSL 1
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) 1
#ifndef TARGET_SUB_OS_CPP_BUILTINS
#define TARGET_SUB_OS_CPP_BUILTINS()
diff --git a/gcc/config/glibc-stdint.h b/gcc/config/glibc-stdint.h
index c8d7ba18d1c..f095197514f 100644
--- a/gcc/config/glibc-stdint.h
+++ b/gcc/config/glibc-stdint.h
@@ -27,6 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef OPTION_MUSL
#define OPTION_MUSL 0
#endif
+#ifndef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) 0
+#endif
#define SIG_ATOMIC_TYPE "int"
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 7fcf402b416..ab62a1741f7 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -29,18 +29,23 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* C libraries supported on Linux. */
#ifdef SINGLE_LIBC
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
#else
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
#endif
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
+#undef OPTION_MUSL
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
do { \
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index 47c9d9ac0b6..be04462d357 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -27,18 +27,23 @@
#define NO_PROFILE_COUNTERS 1
#ifdef SINGLE_LIBC
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
#else
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
#endif
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
+#undef OPTION_MUSL
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
/* Determine what functions are present at the runtime;
this includes full c99 runtime and sincos. */
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 43499ed29cf..1d73a09a476 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -267,18 +267,23 @@ extern int dot_symbols;
#define OS_MISSING_POWERPC64 !TARGET_64BIT
#ifdef SINGLE_LIBC
-#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL)
#else
-#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
-#undef OPTION_MUSL
-#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+#define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC)
+#define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC)
+#define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC)
+#undef OPTION_MUSL_P
+#define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL)
#endif
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
+#define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options)
+#define OPTION_BIONIC OPTION_BIONIC_P (&global_options)
+#undef OPTION_MUSL
+#define OPTION_MUSL OPTION_MUSL_P (&global_options)
/* Determine what functions are present at the runtime;
this includes full c99 runtime and sincos. */
--
2.35.1

View file

@ -0,0 +1,75 @@
From 400bae077d11c3a2ee9f4c8b96c31bbf39416a4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
Date: Mon, 21 Feb 2022 04:13:47 +0100
Subject: [PATCH] x86: Fix -fsplit-stack feature detection via
TARGET_CAN_SPLIT_STACK
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since commit c163647ffbc9a20c8feb6e079dbecccfe016c82e -fsplit-stack
is only supported on glibc targets. However, this original commit
required some fixups. As part of the fixup, the changes to the
gnu-user-common.h and gnu.h where partially reverted in commit
60953a23d57b13a672f751bec0c6eefc059eb1ab thus causing TARGET_CAN_SPLIT_STACK
to be defined for non-glibc targets even though -fsplit-stack is
actually not supported and attempting to use it causes a runtime error.
This causes gcc internal code, such as ./gcc/go/gospec.c to not
correctly detect that -fsplit-stack is not supported and thus causes
gccgo to fail compilation on non-glibc targets.
This commit ensures that TARGET_CAN_SPLIT_STACK is set based on the
changes performed in 2c31a8be4a5db11a0a0e97c366dded6362421086, i.e.
the new OPTION_GLIBC_P macro is now used to detect if -fsplit-stack is
supported in the x86 header files.
The proposed changes have been tested on x86_64 Alpine Linux (which uses
musl libc) and fix compilation of gccgo for this target.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
gcc/ChangeLog:
* config/i386/gnu-user-common.h (defined): Only define
TARGET_CAN_SPLIT_STACK for glibc targets.
* config/i386/gnu.h (defined): Ditto.
---
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 00226f5a455..4e3fbb1de05 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && defined(OPTION_GLIBC_P)
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 25fbc07f58c..41a6a37dfee 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -41,8 +41,9 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
#define TARGET_THREAD_SSP_OFFSET 0x14
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && defined(OPTION_GLIBC_P)
#define TARGET_CAN_SPLIT_STACK
#endif
/* We steal the last transactional memory word. */
--
2.35.1

View file

@ -0,0 +1,33 @@
From dba87d9796b61f4f3eea83c200a2d208564e2277 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Mon, 21 Feb 2022 10:04:47 +0000
Subject: [PATCH] go/gospec: forcibly disable -fsplit-stack support
for some reason, TARGET_CAN_SPLIT_STACK still gets defined on 32-bit x86,
so hackfix it for now
---
gcc/go/gospec.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c
index cf8d0f2b60e..d5bfa57ea45 100644
--- a/gcc/go/gospec.c
+++ b/gcc/go/gospec.c
@@ -269,11 +269,12 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
/* Copy the 0th argument, i.e., the name of the program itself. */
new_decoded_options[j++] = decoded_options[i++];
-#ifdef TARGET_CAN_SPLIT_STACK
+ /* Hackfix: we never support split stack on Alpine GCC */
+#if 0
supports_split_stack = 1;
#endif
-#ifdef TARGET_CAN_SPLIT_STACK_64BIT
+#if 0
if (is_m64)
supports_split_stack = 1;
#endif
--
2.35.1

View file

@ -25,13 +25,13 @@ _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-aarch64
_pkgbase=11.2.1
pkgver=11.2.1_git20220117
pkgver=11.2.1_git20220219
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64
pkgrel=0
pkgrel=1
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
@ -245,9 +245,13 @@ source="https://dev.alpinelinux.org/~nenolod/gcc-${pkgver}.tar.xz
0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
0043-stddef.h-add-support-for-musl-typedef-macro-guards.patch
0044-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
0045-Disable-fsplit-stack-support-on-non-glibc-targets.patch
0046-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
0047-gdc-unconditionally-link-libgphobos-against-libucont.patch
0045-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
0046-Disable-fsplit-stack-support-on-non-glibc-targets.patch
0047-x86-Properly-disable-fsplit-stack-support-on-non-gli.patch
0048-gdc-unconditionally-link-libgphobos-against-libucont.patch
0049-properly-disable-fsplit-stack-on-non-glibc-targets-P.patch
0050-x86-Fix-fsplit-stack-feature-detection-via-TARGET_CA.patch
0051-go-gospec-forcibly-disable-fsplit-stack-support.patch
"
# we build out-of-tree
@ -599,7 +603,9 @@ gdc() {
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
@ -709,52 +715,56 @@ gnat() {
}
sha512sums="
e756307338258432bd8dfc41cf27440117bca4cd7a3a80a7009eb06d06004ade0a61eefd773969ed6578afadef96b4813d41961faf8a43c28d0af77a388fea7d gcc-11.2.1_git20220117.tar.xz
7e5d342e302b376c729e17998d3fdbb8397ed9330c44e0335c4a7319c010bb8d1680c45f37d9eb96d67f99d052290fe943aa818799307271a846a50232db0aa0 0001-posix_memalign.patch
fe147a13e8e460a8ec6df26b7bed67455d55bd6ca238fc52f04095bb8151ec54c85bb048a90fa0ed4f42f97caacd158dec0b3651f32ecac3ce39c53e18aa3747 0002-gcc-poison-system-directories.patch
6d8d6335ae657a65fea2bfed74c1da41208ae8849bd156622425c691d45d29a3e42ad419284ca70630c10cb14a458322dbcefc23ee87f24b85fdd0bb28bedc61 0003-specs-turn-on-Wl-z-now-by-default.patch
122e99feaa5954aea8f9bf9157b1d486725ea6643727eee440ab818d4a69c817eca6ac5ece3952687e53ca92781c3d00b5ae3e6fb20c71880377ff1b9c72650b 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
dc98a6f99dbaee44b1fb1ecdb5eb924a9636d705dc556d1a760611b0d38c215b9e33a9cd13f5307d2d3c16f86ebe8e9f700ecffc05cf9739554f57f3d953da0b 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
f55372e68065c31020a8afb5bb0b341a155f59887c8723151e3d2842f1a93842e86dc91a3860661762fbba6de340ba75727ad87e04b177975428f5d4010016d3 0006-Enable-Wformat-and-Wformat-security-by-default.patch
f599d8c0e65782938a1fb31d40720f31c9f0acb4fa7a34b3dd732dc0ead211447e8f9d153dd527471acea0508bdf625056a2128ab43f247080068bc54b711e85 0007-Enable-Wtrampolines-by-default.patch
2a1f0c8f1a956e63aa4f61154a883aa510d619d5c5e3acedac2b19d0996d97e35f30e47fa7dca90f24fc8b6133860c91b43379afcf57fcf677c3490e7320cf2f 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
140cbba61b82069d153416be4b0ac6164280f2a8f9c96f122175dba0c1ba6ea7aaba3c32db38e580c1caed4a94d4f2a22972f021ca82c3a609b8287f53d40a23 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
39bad14674b741e4745b6e1a6e3f34af9c37b8b8258cc2b260ac3833e61480aebded0afc33ae45c7c126b4b5debfb01439a02521d4b299781bab0532736f462c 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
ffe5fd575cce27ba84b05a1cc37df8b3f5fa5c879fe4214054b6b441b85df974ac6f56d45eedcdeb81a4aa7db3418977e7acc50b05343ded15049d9d40da4f83 0011-libiberty-copy-PIC-objects-during-build-process.patch
07a38d9233f1541cb3ba9c64b1ed8078c37fabeee46c4fb223171416105091cf8ec388b1dc7db4496b2da62c4198534de379e0f99490ff8cfb5cf9e508b0188c 0012-libitm-disable-FORTIFY.patch
a42cf4072d23010b55be2d87e8a345dcc9cc09e3a655c8624d231659647d776053381f245a86214d1a11f3bc607248d08881e014d51e3920fb5659656d4b70e6 0013-libgcc_s.patch
8b30699003a32f81ab9db6091570ad473e3a7269b2e4a1a1c0381c09031cc360ad8189f4f1cf7805a683e72b190752d5b7667626c5e4d8dd6ccf1741e7c53d6a 0014-nopie.patch
cfe8a7a8060022d4210cacdac6a863ca1d9ab0f8e68c93928cace8d5219bb2cea6fa8aa78ec3217df51c44ff0b3814e3a6d5bce22375ff67da749d385e3d3f5d 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
511ab327571ad82f58acf94d9ec40c7b0920a1b163ff1aecce185281fb6121624bf2c1cdc6761bc794601882d0973fffb4664031315f0eab2623acc5ad40621a 0016-dlang-update-zlib-binding.patch
49b8d10142e1cd5a01235cab5560d87d32a8c6c4f05e14db521eee1809128b038695e49dc5a61876e35a34845b2241c0169cb58fc0011dab62af2b0e6b185ca5 0017-dlang-use-libucontext-on-mips64.patch
b092da7ac532fcb7b931d27eb0175374adb9f4a16e782c4f803af9cf073457b074f0c1fe0065a03f8432f2d422fa4e0ebe760d849d8f614337e33f3f027bb714 0018-dlang-libdruntime-define-fcntl.h-constants-for-mips6.patch
6604a8653b660655baa0ed844326f49a6535e12934bc196acadf19fbcb83a37ea455e3a1fc60d529d62a672e5fbe97524b278eaa8fb3e25fb4a6ba362ef9ca91 0019-ada-fix-shared-linking.patch
37b534d4c9fbc340e5df790e85b8997986db100fd86ea1b27b912ef5fd0ce5f6b248e468ffbd03e0a543906f57dcffe33d3975c63dcda95efac6713ed03c1606 0020-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
1c8be5fa094ad499a021e983d9f29a9e4375e03e0633c789aebc0ee7af0d33c4a1ac952257e3a807f17b7393d110657bd149459e0526a56b4f6380e09d3c4eec 0021-add-fortify-headers-paths.patch
ba1d19e92e85551d8581a9eef6c103e1aee2ed47af8f6261d1c26c5d26b7a4b94cc98a6a22936f0d6ef868f3ebf77ed9cb5e8f3147a33c7270810084c47e22a7 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
d1aa039a04a69a2b08ec44a54541c90b66be6b19d24a1060c587ec72e40adb1e8c33e2a5036f8c1f9b43a062c373b094e57f4bbb1225220c1527218661e5d9b6 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
d5468649da2e973bc7ce389dd9797e0b3bb2acf93b3f17e0dcd9cf70b79fb81dc0268d0989693e72821a13376c134c648942cad6b8633f6615ac57573153e879 0024-mips64-disable-multilib-support.patch
198a369b7bc67431cd11b3bc179a97349640864b3397d09932002ccea9e3c06cdd93671587ec43cf59aef66fc42649afb2939e08fa0d7354accd3554ede21dd7 0025-aarch64-disable-multilib-support.patch
967b238f8740c6622613645a04415e7fd1a366fe46252ba49271be59b1396eb8ab73211516fda51c2b71f306b195e5527e065a58ef34f14984dbecacae38981c 0026-s390x-disable-multilib-support.patch
7fff62eda6c6b0214825cb2ca29e5f8957b5b3fafdd3e3c2d1ab9036d0d1a62e002b8fca2db750152593ff08aba15ecf281f5a8b1aee662107969f0fd07de3a1 0027-ppc64-le-disable-multilib-support.patch
ee883dd8775eaaf486cb926ec301d53a89043074917afb84fe2d639ff7fa5bb0497c204509f447f9920ddb09dcd73c179056b3790a13b145cc46dff451484b36 0028-x86_64-disable-multilib-support.patch
b1ab2f7a6bbf659b0b37eec3bfbf1f85e017ca1d4382816ce8f0c6db6c3a5328c9ace8ca4c1716e715d6d076eb5e9e3bd6212299ddae7a13776f93dfc26ff1cc 0029-riscv-disable-multilib-support.patch
1990d2e5d38f338b7beb888490cacfb0020a9c836402400f6b828341f946ff65bdc77b872f470fdfeaaff3e933396baace3233d3bf21fad76f999c0ce916d8f5 0030-always-build-libgcc_eh.a.patch
0e7db3d9ab218122beecf663fe2cef236ca02538bc465f002a3fbde295d2d90e75b6b95942cd9018f72a466ecf149fa6d785999c75862d409ba10f6dce5a969a 0031-ada-libgnarl-compatibility-for-musl.patch
1c4cdbecffa8a46b5fc21b886a03c8d7447d90b0c44f13438f431b02f66583894166c4798df9d71c45006df43d3808748f52be18317197eab629b7630cdbe5ec 0032-ada-musl-support-fixes.patch
bb0f762bbfde7f38d1e82b2a443e3b8e662460bbe797f6260e51172d12a32c502d7b98c5d738f36da16d47a38bc739231fd5a76222159f5c50c034929da5b6e3 0033-gcc-go-Fix-handling-of-signal-34-on-musl.patch
fe5817651c3a1d981da6e4f34302d9345db5dcfe4e48feb1ef303620ab4f145ac758c80e40ec4ed442c445d6a1b087d175fa16d0e88c419aaa7e627cd884e369 0034-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
61225c94843c8fc89cdc84c4e04e9c5f3c113e3ec893d2e4be2935697851a29501cb8a2c8272a7ebe3b5fce110b061579b58439dfcb40a85224eba0f53ab082b 0035-gcc-go-signal-34-is-special-on-musl-libc.patch
b4898ff728edef81b7553aa619ce4036256abad907e7c3e00b027a7552cd84fd79048021d29bfaa18a4f75b73f6207e4da63e010d01eb906f6db12cfdd88cb67 0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
715e21327c3264f81503116a86a8f725590e58be3249632d4e4c7f81ee3e82c86ec2745329acf8f413c234fc8b3a0e0a02cbfe6d0ea625486caaa3cc8a93951f 0037-gcc-go-link-to-libucontext.patch
2e7588d07594e7e84e797bcdf2d6983c6f33a4303374643d23b56d595160c61d8777495c52a3739d99bd50b7b8c06749f1462dbc05a4076b23a4344438ce887e 0038-Use-generic-errstr.go-implementation-on-musl.patch
766aa0b11ff8270ee5850ae4167bc2b84ec2c98d8f68e8e0f2a474f2ac27c3b45c7208afbe4d2051a526691107ec00d8258264d40cf5fc086ad40f63acd5630d 0039-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
7f79cd3bc3b345ad8b5d3d9494db285d5d1da57f4c1fb1f57aafe21d9a2f9c091ec1da9a64550d6bf7473f92adf7d249dfdb255c31f54ef2d0829b47e854d471 0040-configure-fix-detection-of-atomic-builtins-in-libato.patch
f5b20eef9db3a60a7a0f3214a92fdd5ab7a158ce7d36bfef002a469d39f1fedc1531250bde80d56c640066a22145ca0707f4b2ae779d19e18954db1cf45102cd 0041-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
ecb6a3836226fc43e72cee0fe1d59dcdc435e0eaf66378e31d1b6e8109572674c553a954a3409d733fea213ceb9dde8804b97f5802d1f5bc6c8f89c19f81558f 0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
9e6a5942b9b23df83aa453fa1440a3c90861f4760c8fb0481d24efa9c68c9bdf6bfc211877000221a7c663a907f01d26ce0798825b6bc0b82c1549279144e223 0043-stddef.h-add-support-for-musl-typedef-macro-guards.patch
e9cd07f298fff1539e835b7cf440c17acf5fbe2ab4b468e645634e0005bdc45992b25de41d5766a9884beeceb8e92231f5e93967c801e96442327db6d4e6f987 0044-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
2776ffba938a293c7589483684a2c75991fb500918899c2853efa61a7e8295a5dcd192085730c835c6fd51afcee4d84d8c4883ba71230a8d4ceb65691940e13a 0045-Disable-fsplit-stack-support-on-non-glibc-targets.patch
51edccd279c70628d8b34db74e2667de75482ed659f1a5f57407f433af89163d9b6b47986467a59d534e2177f872e5de90c95ede1dc8f1b2829fbe57590d8f4d 0046-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
43b67d2970dcf65d90149ff2ea4f7264f7e01267f3152b0a244850e4f8a6e43da117015dc75dfd30c6428f7088d3cf4b6703f8735f0430959f128ce53de0b821 0047-gdc-unconditionally-link-libgphobos-against-libucont.patch
94d4d2e31f5a84455055d34cfbbcc63d5bd63e60345c2a4e30aa404724e65e5d14868ef50b7fcf5537dd12dc6f1381a27cede269801050e193b4bdb8f2919971 gcc-11.2.1_git20220219.tar.xz
d46a87edb919697a37c15af99c9142c6ad8ec364fe9b5747f5808368e619766163d3d8b64e987b1155785ddc91b5b191b795857cd70118d64f978e46b476bfff 0001-posix_memalign.patch
59fa772417c1d1baf8bd8477ef4e30975fbd616d949fbd72fa88cc72d9662f2e28214305a188d75e30c54a95be111c7998784f7d1499562490acbe194a3c2116 0002-gcc-poison-system-directories.patch
556240f9888c24706694560ad3ba1a90d3ed6da1dd3d7eebb603f4e3551d5743908840d4b1f598d6d5dc3cc52bcfafbcd777282ec8864051c3c8aba623866d3e 0003-specs-turn-on-Wl-z-now-by-default.patch
747a2ba2c0227471dd8a327bddd4699aa6aad5ddce2e523816e43e04fd5a4d8c2f1a69f02980632263ab1c23334d01e27d5df737a0ba9f6bd16b9c85112de82a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
0fe2b802ce0b9c986d7ea5378df49899b028baad419ccd4071fd1a2dad90736e0f04eef29056f6c74c1fa2482359629b5e3747d58fcbf3520c6ed10c66c7b87e 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
7d37f31108cddfeb25ebf7e462d999873dc184bb26f74c9d7d6d32534a15070291661ab58be41ccedb44af20de0568e704b4152668c6bd803cf88f1ddfb6e35c 0006-Enable-Wformat-and-Wformat-security-by-default.patch
698893670d00df1ddbaa7dd970b17049f94d0cc2fec3225925bbad606e44c29288e38a7afa4b4cae3c9c26be35646c52e9eadc67022b89d7b4ce97ce64a5a2ac 0007-Enable-Wtrampolines-by-default.patch
b549d45824d6b9f2ec830ed66ba192ebfe9d9c3db554bf0b51379e9b624de0f0a1a315520487a1a3bfbe9d65d41c41239b9461bc9f1b5059c51d5f4dc7581872 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
15089ea9465057f6897d5c570e79abd068b85f9fc77490668872397699025905aa065eaf7318ddb0847747da4397676242064f290b45e16f616bab86258be260 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
cc9aa31e3b4227f7887d9be470bb19cb3ccd8125155741721921b4c8f791710fabc279b492232454fda0a47bf98509bd2fd4bcdbf5a5aad8b8f476bc5aa74d07 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
c2c74411717e5bf6e261bde4d5c50b12645de2d556b3eb898600e7629772f7d9d213e32f5a0b81d8ee2ba2e4bc55ea64ee60119d9d9a03045574016d94b76f61 0011-libiberty-copy-PIC-objects-during-build-process.patch
d92fe356d745fbc858cbb338b0027b814a2f7812fc7bb6147d641e7319d4ff09ac4ade766b419566e70e6250847ec56e95fd74617a82069dc93f669d827dd48e 0012-libitm-disable-FORTIFY.patch
2e5c0845581c92573fc2e60f7771d9f99e23fd32bf4da7c09bc1738f69174f8becfe9f0c9ee96fbc87b3264dcf2d4b801d051606bd528b43e76cd1fb9ddf6b40 0013-libgcc_s.patch
2a79fd03fe9b98cca3cdbed368969304f9ebcedb7701703740c30a1fe70bfdeceaddac4cbf796f60ee080f0d62a926da6c48042c563b081d9116691c4531a68c 0014-nopie.patch
4a1d53c120047702ea51df3c611af3e4ae82b9cf63dc8244ac38042de44b24afe98578e70aa964884b22ef76ee65d1d703355defc613637acf52d580ce86f17c 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
64065ec9243eb12424cb75822219376e7829f1e1d206d93c4b4cbe18eb4e538019361cc1b5b7d88da4d2d5c891d9e282d579902db534d09b7d58ec91bfada6b5 0016-dlang-update-zlib-binding.patch
35ffecaa8ec56b64c73df93530d858632f0429de007d70869432c183610d344711a1552b1bb00f2180ae952c66a66e1c6285139a8818d656691a121cd7abdba7 0017-dlang-use-libucontext-on-mips64.patch
f78fc1bc99669a90bd68051f9d17bfc25065e49c7d4e853cda293be3a9f17b08867de31e73b90a82b948005f5e17020ccf55dfa4a1b0b9b0cba707c0ed635a46 0018-dlang-libdruntime-define-fcntl.h-constants-for-mips6.patch
463ce54bb32d9ba52ed7f0d7df99011f17543e80f6aca9a61b747e074662b283c563434b96a0bc8ae4636e154f1033c5720f3c8113bc6ad095592a1d5584981c 0019-ada-fix-shared-linking.patch
194647e5a87fb7ebd7602eee9ffa5d3e713dc26baa5f8fa50ada513ca5d28898d1fcee5e9db0d3af6d5b774961426fc1e2f9b5155992ead9981412c627967219 0020-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
d707e47a10c866c0e6d085f9a2bfa1b21eff8e6a1b222840abbbe1b2f21cc4a50f4fa45f7dbbb1ad86dc2eb7c88160c715e69039d3de7f7784de7d5f2a87d6e4 0021-add-fortify-headers-paths.patch
e746e250451eb76726a9de8f42de5eb1d23a228fd3d8961cd2a6c6f691a5418fcd32a817998e3a5aaf8d2d90cd03371aaf7912c9b834ed6c663c649f85f1d058 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
c6d3a4b5d541b52f44641e59556c6312d785c4e12d47fac11a530ae0746170e891c0ed64ce6e9856e5581debfae0d5216753afaf87df1a2d40d50bdfa24ea7dc 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
a29ad877662bbdbc6422456d32ed31aab3764edcc1eb3e1abe7be0f22d162da6d0f0d6565a25c7a43bf23151faba0492122ddcf832bdac57b3e47f89a6ab158d 0024-mips64-disable-multilib-support.patch
18be870ec68865f4661ac73f9bf50765164711582b497beb852928e1d993bc257a0d2b015f435e93461c35edc1811505d31f3a46147bccb4764dcf9b8319c93a 0025-aarch64-disable-multilib-support.patch
b2b830626396936be105361e87c82490b5cd3d26ce7b8dbccf156d53eb5d0db82a28167656aaa5e47b6a1315263abf070432db693c5ae10da892217ce2728728 0026-s390x-disable-multilib-support.patch
094ed675ff5512829bbf7f2bd2632498300b7f15cec6b4a397b145f378a41c17c99f05ea0b94ed1408773a3e8b1fd713ba302c64dba00269df270d401b0e6443 0027-ppc64-le-disable-multilib-support.patch
ee67238c66132f30fd00cc084d37012a927abe32ac48b4617779f22069d86384826c063b79626ab64f6adefdac0f00fcd5c18b95c8a2f11fb2cbee67babc9beb 0028-x86_64-disable-multilib-support.patch
2ddf60a03db15c9c3e847001e300a54dfd9b5435da630e18379313e516fccbb8ea5e26571bb4f88baa6756cdb5c8ba7d059249c46a2f56e67bfca368750431eb 0029-riscv-disable-multilib-support.patch
e7f9088809a4a4b87a6a5670227fb31766fb124ecdcea9936b00a7b98fdc06d7e7f27b6f67a575c434ba978623cb5f1183691dd63d6db98b180c4e08d62e5c5e 0030-always-build-libgcc_eh.a.patch
653b2dbdf43ad336e75aa33ee3e520edd4c8cdb486bf8f5a30dbd8496b96451aa508e12e6a81dd16d36119f22fb9b0c46bcc39d731c89443c435fa4d1ca6fa08 0031-ada-libgnarl-compatibility-for-musl.patch
9d46489087018366eea3b6537f6a86b0e183c7d49f8fecc2f50fbbcebf78727f5a1661ee6a50b5bddef0d54ebe47668ad61440784495194420b0896d5bd3f1aa 0032-ada-musl-support-fixes.patch
63a2f9a81f94826dfac05073d6b7cb599c5b1d026c460edfd329f770c72208e369af1e427904528351aa78bce6e9445af9c59ca73ef5302f7362027757fa5d46 0033-gcc-go-Fix-handling-of-signal-34-on-musl.patch
8d3a01d7e5e983eaabdf5c4a7e58ef33c55a794ed4cb5d438b41218ded367d3214b868a5c8d68f52ef74b0f83abb95d29b36ef8d0c7be68f7d1537a04e65d5c1 0034-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
56c7c1911fef05beaecfa1b41703d46d18c5e967430c79c719f8685f4c4971bb177f2de35b0a1631d5d3ed7292cb54c618e52fa859f483fafb5445511e5b226b 0035-gcc-go-signal-34-is-special-on-musl-libc.patch
07921d5c30f3a23ba1c0540e106abe49e1675f183ffe2b326bdab80c59847b9ed5f39efd2836bc47d4ac1b3a3152f8de092c498ba91682e51c20548a65c0f105 0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
ef8df8a047b4145f30884b052345e4e390fc1efb35a9c7da63899aa115c19b8cc04513a57b2340a6a58ed02dc6881b10f684da653734afe5acf69761e3d064e7 0037-gcc-go-link-to-libucontext.patch
cf000459b493815bb0c9bccbbccc61ab8101f067b5b45d0f30cf49bf0ec6745f6ae360e4b5dccdb5c9bef1974835830efbb349c2ab38d1ee4dcc22385546873b 0038-Use-generic-errstr.go-implementation-on-musl.patch
0baffb0d19c26a387d38525c87b3500c4486bf11aeb9d98cec559eb67db4b71d5bc580fa6aebb9a12295422edb53aea77101e521e91f5189c744749448b89b4a 0039-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
d80074e1fa09cf6f7047a4dac7acadcfb53fcc93667af3348c61b22390999d618f2b16107c30a0fc52b145e27f14d6fddbe43ea36e6a9089741cb3b0b64fd856 0040-configure-fix-detection-of-atomic-builtins-in-libato.patch
04434b605d71b6d4e9dedd03a810f250725d31fc70a5ad28d69499a04436caf6b0ec69f5c7223cb511063cc18c350ffdd95b722de97467f827789006ebcb2c73 0041-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
a3dc43ba56f12f4243c186572b32809d47a9d29c7a40edcf7f6da34c7add65a271c77635a5b9ae325d167e24a2e6bbe883c63eccec3af5d6f925cb304f8ba92b 0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
04ebbf2143a2d4b6c6d768c3aeea2899e6261adf414e16faed1247bc94eeaf61e54f88a2ba7ffdca90e9c0ee87c6fd7e3746481d184c539b8e0130a14b215fa7 0043-stddef.h-add-support-for-musl-typedef-macro-guards.patch
e47183b5a565bdc64a497e14124d767a3e889e9f9d77a92567b0047b285c5ca49897b46ba681e339a8982611b70583ae87a3472dae33f07becaeceb21b3cfe74 0044-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
a5adab61de2d4b2c3ccb1a55c70384a8496c447f7727a6680fa29263c4f57599a3dfb85e1e322859797f86605491af0f68f9dd1141ab4bbbe8b5183f67f3b32e 0045-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
9c0e461eeba709110ca88d60236190c9b71d57d4e13786e2f15521a902e37dacc08d466966764abce9bc84e27d06e2e8523a1a80325f8a16d6ec16d2bf89fa05 0046-Disable-fsplit-stack-support-on-non-glibc-targets.patch
f62778ab53125a9ba5a8088e064c2182c014bc264a46fd3d28d1ee0142dd02a7ed2c684dc63e9768a56a6f8f65621bea20026cd6b65053c2ff9ee51568ee260d 0047-x86-Properly-disable-fsplit-stack-support-on-non-gli.patch
c44c6e5b28b622897af60e7e2dbf0d0284379eb57b39b480936e6d8b3743a24287c2a9ed69a530ef4f2327b5e5ca61ce00e92d415e0ed033e54bdffde345e6a9 0048-gdc-unconditionally-link-libgphobos-against-libucont.patch
160ef16fde90546474e1548f1487c18d9b8edbae1d42a13ad06041b03214d06ff2c3586acd4d0bae27d48e48bb651861c6b9a140ade4ac59f00a268e85275da4 0049-properly-disable-fsplit-stack-on-non-glibc-targets-P.patch
f4d9ebf6d5c80d2f303404b9bf315bf81435c0d369b03b92f8e8510d82db72c2a30d84603307ddc0697df3845862ba93045e4a3724f8e491e7c01bd4396d8864 0050-x86-Fix-fsplit-stack-feature-detection-via-TARGET_CA.patch
8ac54b3a46f7270d975fa3e1198ac37a2311a4b9940938958ffc148e4e9c82c3e81cf3e3c3abd43cef29137897cd6768220b432f828672e036308f7994422d2e 0051-go-gospec-forcibly-disable-fsplit-stack-support.patch
"

View file

@ -1,4 +1,4 @@
From e289226f5f16db14ca549efb41ca82accfe7ea8a Mon Sep 17 00:00:00 2001
From feb04e50d907683385cc4dc0163cf1d82258073a Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
@ -38,5 +38,5 @@ index 1b0bfe37852..d7b2b19bb3c 100644
else
return NULL;
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 48be81c9accb55c3c5ee683c84fa1f908bb18764 Mon Sep 17 00:00:00 2001
From d64825212f807435a4b2f8e068c0f65195c8e2e6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH] gcc: poison-system-directories
@ -120,7 +120,7 @@ index df1c9cc3200..5461bab88a9 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5a4b3c6c234..9d1126e9751 100644
index cf536a15116..7d3f1ccddf3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
@ -131,7 +131,7 @@ index 5a4b3c6c234..9d1126e9751 100644
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -7727,6 +7728,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -7728,6 +7729,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.
@ -199,5 +199,5 @@ index 446d280321d..fbfc0ce03b8 100644
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 767b97ca271e82601a435015190fd15bfb28ae12 Mon Sep 17 00:00:00 2001
From 9675297b3a46b65a54e9df97f26ea445d53c67c6 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
@ -14,10 +14,10 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9d1126e9751..4b8335bbd1f 100644
index 7d3f1ccddf3..485d2d6b742 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15920,6 +15920,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -15921,6 +15921,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
@ -40,5 +40,5 @@ index a83ba34ac4b..faf9ce76b3d 100644
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From b8abbd503d1be992bf1d204f0e6de5260fcdf533 Mon Sep 17 00:00:00 2001
From 4eb1b3849325b77c4cb66b675119299de35125bb Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 9f993c4aff2..7db314195ff 100644
index 11e015bdb87..de8b7bf246f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1421,6 +1421,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1427,6 +1427,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
@ -25,10 +25,10 @@ index 9f993c4aff2..7db314195ff 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4b8335bbd1f..833164e0a2b 100644
index 485d2d6b742..164929f7583 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10224,6 +10224,12 @@ also turns on the following optimization flags:
@@ -10225,6 +10225,12 @@ also turns on the following optimization flags:
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
@ -42,5 +42,5 @@ index 4b8335bbd1f..833164e0a2b 100644
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 1837896f54bd318788c1ba6dbd19c3efe147ba20 Mon Sep 17 00:00:00 2001
From 8de5d46c530ceca9f4add46d5cae3cd52c38eba3 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
@ -268,5 +268,5 @@ index faf9ce76b3d..1ad5da6d769 100644
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 1ba693868db68bef5178fd797c9e7d2cc4128182 Mon Sep 17 00:00:00 2001
From 85e12e3d32a44c3fd10b5327edd542972a179eec Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
@ -30,5 +30,5 @@ index 2005b783c68..c5c6af427cc 100644
Wformat-overflow=
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From eb2f1f7d7c503959279a7317af7b9a7625eecc6e Mon Sep 17 00:00:00 2001
From f1e92f5f3576779776c9f3d6aeef76e1569e719a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.
@ -21,5 +21,5 @@ index d15105a73f3..29f9504cb68 100644
Wtype-limits
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 7a4086e83e3abbf2c20b7211e2a2c0bf00f25ff8 Mon Sep 17 00:00:00 2001
From 3503fd734a33b67ec6a9fdc2c52bb8310864b119 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
@ -49,5 +49,5 @@ index 8ba281b4cfa..bab39cdf8a2 100644
-param=stack-clash-protection-guard-size=
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 1c38cbf1f75066c3acc145f449f1fbd0b5de7968 Mon Sep 17 00:00:00 2001
From c4dd51fe15a938fdd76d781a4eede2a9205eacbc Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
@ -50,5 +50,5 @@ index 8edd2e05639..63f61fcf96f 100644
all-local: all-local-$(USE_NLS)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From e4c844ce0c1c355c2d1cf6a6e1595030b8ce2a5e Mon Sep 17 00:00:00 2001
From 0a1fd78184f00fb77dac00dabe98eb025620efc2 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH] Don't declare asprintf if defined as a macro.
@ -24,5 +24,5 @@ index f4c0fe11d6f..cf4b1043e4d 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 79309ae34db26104ec85f6af31a4a8133142fe6d Mon Sep 17 00:00:00 2001
From f81d67f6fe1f1066642606209c882b333d937cb7 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH] libiberty: copy PIC objects during build process
@ -20,5 +20,5 @@ index 4f1213b983b..d0224649d30 100644
else true; fi
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From fdf5ef3d1e61625cb96647d5bdc4ca0a32d287ec Mon Sep 17 00:00:00 2001
From 3b732288ce771348cbcc9fb633a36b7aff2b4ad4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:36 +0000
Subject: [PATCH] libitm: disable FORTIFY
@ -29,5 +29,5 @@ index a3d84896cc5..ecb281d5919 100644
# work out any special compilation flags as necessary.
case "${target_cpu}" in
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 9442d683845f63b931374ff81a7d08a31f992135 Mon Sep 17 00:00:00 2001
From a3e556187d0a8e9d39544f023960eca0f07d3e83 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH] libgcc_s
@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 16765718cc3..4a855b791b9 100644
index 1772fb16c9a..77e04b0c2df 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -11063,10 +11063,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
@@ -11066,10 +11066,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@ -53,5 +53,5 @@ index 8506a635790..564296f788e 100644
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 7a3e354de1ab87e992bfdaf858677ca140b80732 Mon Sep 17 00:00:00 2001
From f520e67fba621f213146271408ff3210b3527176 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH] nopie
@ -71,5 +71,5 @@ index 5461bab88a9..1577529ffb7 100644
AC_SUBST([NO_PIE_FLAG])
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 9a5417a787c2ba197c0a3002ea7423488bedab0a Mon Sep 17 00:00:00 2001
From 37310cabb8bc7256899c4d45cc68a47ca2a3232b Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:57:09 +0000
Subject: [PATCH] libffi: use __linux__ instead of __gnu_linux__ for musl
@ -21,5 +21,5 @@ index 721ff00ea43..22a699c6340 100644
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From ecc537cc597fba87f00d3128fddd5f2a17e7d222 Mon Sep 17 00:00:00 2001
From 586e82425a024d85d1bd9952ca51d8a671aa9b5d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:57:51 +0000
Subject: [PATCH] dlang: update zlib binding
@ -421,5 +421,5 @@ index e6cce240fd5..bd2fe37ebec 100644
}
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 273edfbf9845a349cec0643c23fff5a740c76f78 Mon Sep 17 00:00:00 2001
From 26daa73d678b87a6950df1d79d171ba40ecbce15 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:18:32 +0000
Subject: [PATCH] dlang: use libucontext on mips64
@ -20,5 +20,5 @@ index 0643daeb613..b74d9fb3f25 100644
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 602c9c669e8270f51b8c9c07c3b8840d3cc5d5e4 Mon Sep 17 00:00:00 2001
From caeae8288593dbd5a1a6d93508d875eb0d8fdf49 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:19:12 +0000
Subject: [PATCH] dlang: libdruntime: define fcntl.h constants for mips64
@ -34,5 +34,5 @@ index 59df921ba41..9ee9f943948 100644
static assert(0, "Platform not supported");
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 94f4f85904f1c042e4d0c0ac855143129d58fdbd Mon Sep 17 00:00:00 2001
From 374a19de60fcd5c31321c3f4d26dcc4b631e8c3f Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH] ada: fix shared linking
@ -38,5 +38,5 @@ index 5cd5ef64f56..1c611a82cab 100644
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From dac504eb0d50d751ac558efaf84d37716e9ee05b Mon Sep 17 00:00:00 2001
From ad053bc46b535e78397f992e3c2c1d28c1ebd1f4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
@ -20,5 +20,5 @@ index 047be0255e2..426949aa91c 100644
# This is the list of directories to built for the host system.
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 5cc67e1262c1641aefa6da1e31bc759ecd1becbd Mon Sep 17 00:00:00 2001
From 18d44a7f8d801cc6926a73e2dda2f0ce859dc561 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths
@ -21,5 +21,5 @@ index 4e1db60fced..7fcf402b416 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 154f797756e8098f33fa16799749b4cd827dd81c Mon Sep 17 00:00:00 2001
From 38d27ebdcc5a8bea0807b5d56203f0ea5e16868f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Aug 2020 07:03:00 +0000
Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
@ -27,5 +27,5 @@ index 99314032ec2..6e91767efe8 100644
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From a025b2325486bcba0cdf82a0468013961fe7cb99 Mon Sep 17 00:00:00 2001
From 0cc2a1befaf343e5ce1cbc15bd247eee812bdf33 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
@ -65,5 +65,5 @@ index 6e91767efe8..22dbbf85850 100644
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From da8359d60789065ad866b0d5e3efa03d69829851 Mon Sep 17 00:00:00 2001
From feea6f782e83a53487ad633608484dfa3483be1b Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] mips64: disable multilib support
@ -44,5 +44,5 @@ index 130e1f04707..a64ac2bbb5b 100644
+ ../lib32 \
+ ../lib
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 56a29e6c843999581b043b9a826853f90a2fd1e8 Mon Sep 17 00:00:00 2001
From cbd96a32dc2aaa61f6adcb3643e1da21f185f80e Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:12:55 +0000
Subject: [PATCH] aarch64: disable multilib support
@ -22,5 +22,5 @@ index 241b0ef20b6..18e63b34d8b 100644
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 2886563232a0c829e29a4a8d0e1d83392e134aef Mon Sep 17 00:00:00 2001
From e87e415e9a88dbce68ed7b9d8386c3c2d0c0d6b6 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:13:59 +0000
Subject: [PATCH] s390x: disable multilib support
@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 88e39c0c4bc64a5734fdd6f255b62fd8711d73bb Mon Sep 17 00:00:00 2001
From 5c24869c9bc1a552f8bb5c32a8538c6e065a4db8 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:33 +0000
Subject: [PATCH] ppc64[le]: disable multilib support
@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 2df8f5e7bfe077f5bdb1506d971644c471af4a06 Mon Sep 17 00:00:00 2001
From 25927f8106583ee594e7bcdf92dd1387e0fd024c Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:54 +0000
Subject: [PATCH] x86_64: disable multilib support
@ -22,5 +22,5 @@ index d288b093522..2949033aa04 100644
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From f45e75200cdebab7c23960d3ccebec862e269557 Mon Sep 17 00:00:00 2001
From 18bcf23cae4069ffe9d9f64e851193d29dd4814f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 3 Jan 2022 07:14:48 +0100
Subject: [PATCH] riscv: disable multilib support
@ -70,5 +70,5 @@ index 216d2776a18..1a8a863853e 100644
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 97972b0c9ef7b7f6b7ca87e2bbae6cb4e3adff51 Mon Sep 17 00:00:00 2001
From a46c8d6cb9428db29fbf8a80609ff449354ce111 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:05:41 +0000
Subject: [PATCH] always build libgcc_eh.a
@ -47,5 +47,5 @@ index 2c8be561eb5..c557750b1b3 100644
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 62e3ecf4d1216fb0daf9b12db3f4310170a80f8f Mon Sep 17 00:00:00 2001
From d7064ab25a561bb99c3d0b35663154656013aed2 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:06:30 +0000
Subject: [PATCH] ada: libgnarl compatibility for musl
@ -131,5 +131,5 @@ index 757a6cdfdad..82df94f6a00 100644
pragma Assert (Result in 0 | ENOMEM);
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From a259508e9e3eb1dd5ebd160ac4600cb948d850fc Mon Sep 17 00:00:00 2001
From 5193de0a6c96fefe0c46fc9a6b8c27623ad85640 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH] ada: musl support fixes
@ -11,7 +11,7 @@ Subject: [PATCH] ada: musl support fixes
4 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 987eff0abba..03c8bc6f496 100644
index b5b8b573ea4..6fce40d1e98 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1748,7 +1748,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@ -50,7 +50,7 @@ index 987eff0abba..03c8bc6f496 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2699,7 +2699,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2700,7 +2700,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -219,5 +219,5 @@ index ec9db3a6a4c..6f92e50dd67 100644
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From eec75a34ecc5074ed5857a8a2964d5a1e8fe5a66 Mon Sep 17 00:00:00 2001
From 8a42d93247c375f199f3079538d659f95b9ff2a0 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 30 Aug 2020 17:59:45 +0200
Subject: [PATCH] gcc-go: Fix handling of signal 34 on musl
@ -39,5 +39,5 @@ index 11e4ec436bd..fe866eacb27 100644
if test "${GOOS}" = "aix"; then
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From dfd96cebf29a04f8a89587deb7469274cd206382 Mon Sep 17 00:00:00 2001
From c205f79c18add13247a06cfd843f5eb44c4c3cb4 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 25 Nov 2021 01:47:03 +0000
Subject: [PATCH] There are more than one st_{a,m,c}tim fields in struct stat
@ -23,5 +23,5 @@ index 0c52ea5d71a..6fef104cc1c 100755
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 54aca66b0640f56b7b0473ebd08ec8e9c8edb78e Mon Sep 17 00:00:00 2001
From af64f915a4717036a7f1fe637308b455c94e0f1e Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 30 Aug 2020 18:03:03 +0200
Subject: [PATCH] gcc-go: signal 34 is special on musl libc
@ -25,5 +25,5 @@ index 2eece687e35..e86490ce203 100644
}
throw("sigaction read failure")
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From c61dfe08fa888a93fd1d65484a79dc4dd4260c03 Mon Sep 17 00:00:00 2001
From 6e41b6753af412388e9259fe791904146695e84e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 30 Aug 2020 19:27:51 +0200
Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c
@ -23,5 +23,5 @@ index 38bf7a6b255..e50403b5a75 100644
static inline void
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 9e7be29ad618d48740f42c98ba93e8367341b63f Mon Sep 17 00:00:00 2001
From cc89c078ffc58a7f6675a60fbca24224effcb7e3 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Mon, 31 Aug 2020 08:59:40 +0200
Subject: [PATCH] gcc-go: link to libucontext
@ -21,5 +21,5 @@ index 426949aa91c..f97db1ef569 100644
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From f9defb064cdd5565d308df5d61f6881ea601e276 Mon Sep 17 00:00:00 2001
From 3fb914ca83ac18287ee24aa75aba9149e35487ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 19 Apr 2021 07:21:41 +0200
Subject: [PATCH] Use generic errstr.go implementation on musl
@ -44,5 +44,5 @@ index 5b19e6f202d..8dc60172186 100644
package syscall
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From c25b1e409bd20c7a1c47063e36c75f0dcca0b410 Mon Sep 17 00:00:00 2001
From 52ce9c86c0c89ae45e0d08cc232682e1811aa8f2 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
@ -271,5 +271,5 @@ index 22dbbf85850..90aa576037a 100644
#ifdef ENABLE_DEFAULT_SSP
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 0282e9fc31d4245f0c562ac42fa7c900363c2c12 Mon Sep 17 00:00:00 2001
From 5010fa237897bca92291ba8835123125d4af933a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 29 Aug 2021 09:45:27 +0200
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
@ -53,5 +53,5 @@ index 670b0d72cfe..38c2cd9345f 100644
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From eab088e3a76ce23cf2365351c59707e2dd0aa599 Mon Sep 17 00:00:00 2001
From 2d924c522dde7426afbb8096d9301b17d0e73121 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 28 Nov 2021 00:54:37 +0100
Subject: [PATCH] libgo: Recognize off64_t and loff_t definitions of musl libc
@ -80,5 +80,5 @@ index 8ce061e2f5f..b85add15a7b 100644
// be signed in some OSes.
#ifdef SIOCGIFMTU
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From cad142fc0fa5fa52c886ad8807cc62b34e5f1540 Mon Sep 17 00:00:00 2001
From 72f32e3383129ad139df76d9a063fac9b03079b1 Mon Sep 17 00:00:00 2001
From: Alex McGrath <amk@amk.ie>
Date: Wed, 13 Oct 2021 23:24:27 +0100
Subject: [PATCH] Fix attempt to use poisoned calloc error in libgccjit
@ -76,5 +76,5 @@ index 0cc650f9810..2f44481eeb0 100644
#include "libgccjit.h"
#include "jit-recording.h"
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 4ede09cec9f5df24d0d24e7d82b07a9a0ffccdda Mon Sep 17 00:00:00 2001
From aeef0ee2aac43d89ae26c6a3559aae4f8a1d53da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Thu, 25 Nov 2021 17:44:04 +0100
Subject: [PATCH] stddef.h: add support for musl typedef macro guards
@ -102,5 +102,5 @@ index 66619fe43b1..50d710a5ab9 100644
#endif /* _BSD_RUNE_T_DEFINED_ */
#endif
--
2.34.1
2.35.1

View file

@ -1,4 +1,4 @@
From 61fc6a52f3fc5fe6c66dc2dd0fa222ba1349d7e5 Mon Sep 17 00:00:00 2001
From 36c79820c1085590f272ef1afcad4744125d96d0 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 30 Aug 2020 18:33:49 +0200
Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap
@ -59,5 +59,5 @@ index fa3389d857e..57bed97c710 100644
if uintptr(p) == _MAP_FAILED {
return nil, errno()
--
2.34.1
2.35.1

View file

@ -1,98 +0,0 @@
From 30e4c9be8d17c7806beaca9e78f6aff6ebae6463 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Wed, 15 Dec 2021 00:14:19 +0100
Subject: [PATCH] Disable -fsplit-stack support on non-glibc targets
The -fsplit-stack option requires the pthread_t TCB definition in the
libc to provide certain struct fields at specific hardcoded offsets. As
far as I know, only glibc provides these fields at the required offsets.
Most notably, musl libc does not have these fields. However, since gcc
accesses the fields using a fixed offset this does not cause a
compile-time error but instead results in a silent memory corruption at
run-time. For example, on s390x libgcc's __stack_split_initialize CTOR
will overwrite the cancel field in the pthread_t TCB on musl.
The -fsplit-stack option is used within the gcc code base by gcc-go by
default. On musl based systems with split-stack support (e.g. s390x or
x86) this causes Go programs compiled with gcc-go to misbehave at
run-time.
This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
since it is not supported on non-glibc targets anyhow. This is achieved
by checking if TARGET_GLIBC_MAJOR is defined to a non-zero value (it
defaults to zero on non-glibc systems). The check has been added for x86
and s390x, the rs6000 config already checks for TARGET_GLIBC_MAJOR. With
this patch applied, the gcc-go configure script will detect that
-fsplit-stack support is not available and will not use it.
This patch has been tested on Alpine Linux Edge on the s390x
architecture by bootstrapping Google's Go implementation with gcc-go.
See https://www.openwall.com/lists/musl/2012/10/16/12
---
gcc/common/config/s390/s390-common.c | 9 ++++++++-
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 6 +++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index b6bc8501742..afbd8d3fe66 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -116,13 +116,20 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
/* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
We don't verify it, since earlier versions just have padding at
- its place, which works just as well. */
+ its place, which works just as well. For other libc implementations
+ we disable the feature entirely to avoid corrupting the TCB. */
static bool
s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
struct gcc_options *opts ATTRIBUTE_UNUSED)
{
+#if TARGET_GLIBC_MAJOR
return true;
+#else
+ if (report)
+ error("%<-fsplit-stack%> currently only supported on GNU/Linux");
+ return false;
+#endif
}
#undef TARGET_DEFAULT_TARGET_FLAGS
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 00226f5a455..554e146dbbe 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives and
+ uses glibc. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && TARGET_GLIBC_MAJOR
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 25fbc07f58c..895a7369816 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -35,7 +35,11 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-#ifdef TARGET_LIBC_PROVIDES_SSP
+/* -fsplit-stack uses a field in the TCB at a fixed offset. This
+ field is only available for glibc. Disable -fsplit-stack for
+ other libc implementation to avoid silent TCB corruptions. */
+
+#if defined (TARGET_LIBC_PROVIDES_SSP) && TARGET_GLIBC_MAJOR
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
--
2.34.1

View file

@ -1,4 +1,4 @@
From c1408c2e323bf724db3bb8b1523e4cf5848c7e63 Mon Sep 17 00:00:00 2001
From 353c8abdc34a294c89c24423ef0c4182189117f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
Date: Sun, 2 Jan 2022 01:07:03 +0100
Subject: [PATCH] libgo: include asm/ptrace.h for pt_regs definition on PowerPC
@ -54,5 +54,5 @@ index d30d1603adc..fc01e04e4a1 100644
#ifndef SA_RESTART
--
2.34.1
2.35.1

View file

@ -0,0 +1,115 @@
From 2c6bf28619c9b3bf713f7f5319c5d750a6c297ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren@soeren-tempel.net>
Date: Fri, 21 Jan 2022 19:22:46 +0000
Subject: [PATCH] Disable -fsplit-stack support on non-glibc targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The -fsplit-stack option requires the pthread_t TCB definition in the
libc to provide certain struct fields at specific hardcoded offsets. As
far as I know, only glibc provides these fields at the required offsets.
Most notably, musl libc does not have these fields. However, since gcc
accesses the fields using a fixed offset, this does not cause a
compile-time error, but instead results in a silent memory corruption at
run-time with musl libc. For example, on s390x libgcc's
__stack_split_initialize CTOR will overwrite the cancel field in the
pthread_t TCB on musl.
The -fsplit-stack option is used within the gcc code base itself by
gcc-go (if available). On musl-based systems with split-stack support
(i.e. s390x or x86) this causes Go programs compiled with gcc-go to
misbehave at run-time.
This patch fixes gcc-go on musl by disabling -fsplit-stack in gcc itself
since it is not supported on non-glibc targets anyhow. This is achieved
by checking if gcc targets a glibc-based system. This check has been
added for x86 and s390x, the rs6000 config already checks for
TARGET_GLIBC_MAJOR. Other architectures do not have split-stack
support. With this patch applied, the gcc-go configure script will
detect that -fsplit-stack support is not available and will not use it.
See https://www.openwall.com/lists/musl/2012/10/16/12
This patch was written under the assumption that glibc is the only libc
implementation which supports the required fields at the required
offsets in the pthread_t TCB. The patch has been tested on Alpine Linux
Edge on the s390x and x86 architectures by bootstrapping Google's Go
implementation with gcc-go.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
gcc/ChangeLog:
* common/config/s390/s390-common.c (s390_supports_split_stack):
Only support split-stack on glibc targets.
* config/i386/gnu-user-common.h (STACK_CHECK_STATIC_BUILTIN): Ditto.
* config/i386/gnu.h (defined): Ditto.
---
gcc/common/config/s390/s390-common.c | 14 ++++++++++----
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 5 ++++-
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index b6bc8501742..8c1e590322d 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -116,13 +116,19 @@ s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
/* -fsplit-stack uses a field in the TCB, available with glibc-2.23.
We don't verify it, since earlier versions just have padding at
- its place, which works just as well. */
+ its place, which works just as well. For other libc implementations
+ we disable the feature entirely to avoid corrupting the TCB. */
static bool
-s390_supports_split_stack (bool report ATTRIBUTE_UNUSED,
- struct gcc_options *opts ATTRIBUTE_UNUSED)
+s390_supports_split_stack (bool report,
+ struct gcc_options *opts)
{
- return true;
+ if (opts->x_linux_libc == LIBC_GLIBC)
+ return true;
+
+ if (report)
+ error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
+ return false;
}
#undef TARGET_DEFAULT_TARGET_FLAGS
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 00226f5a455..6e13315b5a3 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives and
+ targets glibc. */
+#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE && OPTION_GLIBC
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 25fbc07f58c..afd3e8e8841 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -35,7 +35,10 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-#ifdef TARGET_LIBC_PROVIDES_SSP
+/* -fsplit-stack uses a field in the TCB at a fixed offset. This
+ field is only available for glibc. Disable -fsplit-stack for
+ other libc implementations to avoid silent TCB corruptions. */
+#if defined (TARGET_LIBC_PROVIDES_SSP) && OPTION_GLIBC
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
--
2.35.1

Some files were not shown because too many files have changed in this diff Show more