cross/gcc-*: upgrade to 12.1.1_git20220630 (MR 3353)

This commit is contained in:
Bobby The Builder 2022-08-13 11:17:36 -04:00
parent 84b6d7a0ec
commit 0c0b623f87
No known key found for this signature in database
GPG key ID: 0BF4C1B5988C50D8
189 changed files with 2580 additions and 5343 deletions

View file

@ -1,4 +1,4 @@
From feb04e50d907683385cc4dc0163cf1d82258073a Mon Sep 17 00:00:00 2001
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 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
@ -8,7 +8,7 @@ Subject: [PATCH] posix_memalign
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index 1b0bfe37852..d7b2b19bb3c 100644
index 3b2e4f47915..20f790904a2 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@ -37,6 +37,3 @@ index 1b0bfe37852..d7b2b19bb3c 100644
return __ptr;
else
return NULL;
--
2.35.1

View file

@ -1,4 +1,4 @@
From d64825212f807435a4b2f8e068c0f65195c8e2e6 Mon Sep 17 00:00:00 2001
From dd1e75ff4ecda96957465b34681f245e818928bd 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
@ -21,15 +21,15 @@ Upstream-Status: Pending
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 21 +++++++++++++++++++++
gcc/gcc.cc | 2 ++
gcc/incpath.cc | 21 +++++++++++++++++++++
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index a75b44ee47e..d15105a73f3 100644
index 8a0dafc522d..0357868e22c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -683,6 +683,10 @@ Wreturn-local-addr
@@ -710,6 +710,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
@ -41,10 +41,10 @@ index a75b44ee47e..d15105a73f3 100644
Common Var(warn_shadow) Warning
Warn when one variable shadows another. Same as -Wshadow=global.
diff --git a/gcc/config.in b/gcc/config.in
index 2de5a463315..059c818c895 100644
index 64c27c9cfac..f0fbf123aa8 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -218,6 +218,12 @@
@@ -230,6 +230,12 @@
#endif
@ -58,10 +58,10 @@ index 2de5a463315..059c818c895 100644
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
diff --git a/gcc/configure b/gcc/configure
index 708328e1670..4b977e313b5 100755
index 5ce0557719a..e9060112384 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1020,6 +1020,7 @@ enable_maintainer_mode
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@ -69,7 +69,7 @@ index 708328e1670..4b977e313b5 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1782,6 +1783,8 @@ Optional Features:
@@ -1785,6 +1786,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@ -78,7 +78,7 @@ index 708328e1670..4b977e313b5 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31790,6 +31793,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@ -99,10 +99,10 @@ index 708328e1670..4b977e313b5 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index df1c9cc3200..5461bab88a9 100644
index 23bee7010a3..75a7048045c 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7311,6 +7311,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@ -120,10 +120,10 @@ index df1c9cc3200..5461bab88a9 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index cf536a15116..7d3f1ccddf3 100644
index 07b440190c3..b2de464798a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
@ -131,7 +131,7 @@ index cf536a15116..7d3f1ccddf3 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
@@ -7728,6 +7729,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -8029,6 +8030,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.
@ -146,11 +146,11 @@ index cf536a15116..7d3f1ccddf3 100644
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 8ba410c9e17..a83ba34ac4b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1152,6 +1152,8 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..47fb5802194 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
@ -159,10 +159,10 @@ index 8ba410c9e17..a83ba34ac4b 100644
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 446d280321d..fbfc0ce03b8 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
@ -171,7 +171,7 @@ index 446d280321d..fbfc0ce03b8 100644
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -395,6 +396,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
@ -198,6 +198,3 @@ index 446d280321d..fbfc0ce03b8 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.35.1

View file

@ -1,4 +1,4 @@
From 9675297b3a46b65a54e9df97f26ea445d53c67c6 Mon Sep 17 00:00:00 2001
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 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
@ -10,14 +10,14 @@ Binutils does not appear to have a similar option for enabling -z
now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.c | 1 +
gcc/gcc.cc | 1 +
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 7d3f1ccddf3..485d2d6b742 100644
index b2de464798a..83bd1bde433 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15921,6 +15921,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -16872,6 +16872,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}.
@ -27,11 +27,11 @@ index 7d3f1ccddf3..485d2d6b742 100644
@item -u @var{symbol}
@opindex u
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a83ba34ac4b..faf9ce76b3d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1150,6 +1150,7 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 47fb5802194..d18b5d7b59a 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
@ -39,6 +39,3 @@ index a83ba34ac4b..faf9ce76b3d 100644
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.35.1

View file

@ -1,19 +1,19 @@
From 4eb1b3849325b77c4cb66b675119299de35125bb Mon Sep 17 00:00:00 2001
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 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,
ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.c | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.cc | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 11e015bdb87..de8b7bf246f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1427,6 +1427,10 @@ c_cpp_builtins (cpp_reader *pfile)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,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 11e015bdb87..de8b7bf246f 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 485d2d6b742..164929f7583 100644
index 83bd1bde433..dda299a9987 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10225,6 +10225,12 @@ also turns on the following optimization flags:
@@ -10896,6 +10896,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.
@ -41,6 +41,3 @@ index 485d2d6b742..164929f7583 100644
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.35.1

View file

@ -1,4 +1,4 @@
From 8de5d46c530ceca9f4add46d5cae3cd52c38eba3 Mon Sep 17 00:00:00 2001
From 75d1a35180cf0967f062765314bf091a64032062 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,
@ -18,11 +18,11 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
gcc/config/rs6000/sysv4.h | 2 +-
gcc/config/s390/linux.h | 2 +-
gcc/config/sparc/linux.h | 2 +-
gcc/gcc.c | 28 ++++++++++++++++++++--------
gcc/gcc.cc | 28 ++++++++++++++++++++--------
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 7f2529a2a1d..b097e1688aa 100644
index 5e4553d79f5..b516f3ef97f 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@ -34,7 +34,7 @@ index 7f2529a2a1d..b097e1688aa 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index c1dae8ca2cf..a87dc740171 100644
index 17f16a55910..9ec667e9a5e 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
@ -47,7 +47,7 @@ index c1dae8ca2cf..a87dc740171 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 0c1c4e70b6b..8b581afacdd 100644
index df3da67c4f0..7532bc29f9b 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@ -59,7 +59,7 @@ index 0c1c4e70b6b..8b581afacdd 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 5ebbf42a13d..902378e1bad 100644
index 857c0e077bf..8433e56c3e1 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -87,7 +87,7 @@ index 5ebbf42a13d..902378e1bad 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index a23e7ab3eb7..12ac8cb93a9 100644
index 0102b2a6f3b..994414c1845 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
@ -100,7 +100,7 @@ index a23e7ab3eb7..12ac8cb93a9 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index f3e25b1412a..712b0f1c30e 100644
index abc8cf624ca..fe656aeae27 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -112,7 +112,7 @@ index f3e25b1412a..712b0f1c30e 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index ac40c3dfd3f..6e19e25c35a 100644
index 93510098ccc..3813e536423 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@ -125,7 +125,7 @@ index ac40c3dfd3f..6e19e25c35a 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index a390bcece83..be0ee289367 100644
index 6aad7192e69..e1256a55add 100644
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
@ -137,7 +137,7 @@ index a390bcece83..be0ee289367 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index fce5b896e6e..ee29979dd34 100644
index 38803723ba9..3067ed6eac8 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
@ -149,10 +149,10 @@ index fce5b896e6e..ee29979dd34 100644
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index e3f2cd254f6..43499ed29cf 100644
index b2a7afabc73..34ceb4e4fce 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -374,13 +374,13 @@ extern int dot_symbols;
@@ -377,13 +377,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
@ -169,10 +169,10 @@ index e3f2cd254f6..43499ed29cf 100644
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 510abe169c5..3c1f3a8ec5d 100644
index 7e2519de5d4..61215a7a1b3 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@ -182,7 +182,7 @@ index 510abe169c5..3c1f3a8ec5d 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index daa48fdfc2b..2fcfc5d770f 100644
index d7b7e7a7b02..d2287f14f2e 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
@ -195,7 +195,7 @@ index daa48fdfc2b..2fcfc5d770f 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 2550d7ee8f0..7596d0b2757 100644
index 6a809e9092d..93bfb92d3ff 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@ -207,11 +207,11 @@ index 2550d7ee8f0..7596d0b2757 100644
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.c b/gcc/gcc.c
index faf9ce76b3d..1ad5da6d769 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -737,8 +737,11 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d18b5d7b59a..3b76311b544 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -744,8 +744,11 @@ proper position among the other output files. */
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -225,7 +225,7 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -773,8 +776,11 @@ proper position among the other output files. */
@@ -780,8 +783,11 @@ proper position among the other output files. */
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -239,7 +239,7 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -791,8 +797,11 @@ proper position among the other output files. */
@@ -798,8 +804,11 @@ proper position among the other output files. */
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -253,7 +253,7 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -807,8 +816,11 @@ proper position among the other output files. */
@@ -814,8 +823,11 @@ proper position among the other output files. */
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
@ -267,6 +267,3 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.35.1

View file

@ -1,4 +1,4 @@
From 85e12e3d32a44c3fd10b5327edd542972a179eec Mon Sep 17 00:00:00 2001
From c664283dd30949c5299d1c45bd5740bcfe993d22 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.
@ -8,10 +8,10 @@ Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 2005b783c68..c5c6af427cc 100644
index 07da40ef43b..8683f706426 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -637,7 +637,7 @@ Warn about function calls with format strings that write past the end
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
of the destination region. Same as -Wformat-overflow=1.
Wformat-security
@ -20,7 +20,7 @@ index 2005b783c68..c5c6af427cc 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -658,7 +658,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@ -29,6 +29,3 @@ index 2005b783c68..c5c6af427cc 100644
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.35.1

View file

@ -1,4 +1,4 @@
From f1e92f5f3576779776c9f3d6aeef76e1569e719a Mon Sep 17 00:00:00 2001
From e4d0ec43e772b6dc7c3708aed5309897df26a125 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.
@ -8,10 +8,10 @@ Subject: [PATCH] Enable -Wtrampolines by default.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index d15105a73f3..29f9504cb68 100644
index 0357868e22c..6d5e5eebe60 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -775,7 +775,7 @@ Common Var(warn_system_headers) Warning
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@ -19,7 +19,4 @@ index d15105a73f3..29f9504cb68 100644
+Common Var(warn_trampolines) Init(1) Warning
Warn whenever a trampoline is generated.
Wtype-limits
--
2.35.1
Wtrivial-auto-var-init

View file

@ -1,19 +1,19 @@
From 3503fd734a33b67ec6a9fdc2c52bb8310864b119 Mon Sep 17 00:00:00 2001
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b 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
Change the buffer size.
---
gcc/gcc.c | 8 +++++++-
gcc/gcc.cc | 8 +++++++-
gcc/params.opt | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1ad5da6d769..99314032ec2 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -989,6 +989,12 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 3b76311b544..cc99d0b7aa1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -996,6 +996,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@ -26,7 +26,7 @@ index 1ad5da6d769..99314032ec2 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1288,7 +1294,7 @@ static const char *cc1_options =
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
@ -36,10 +36,10 @@ index 1ad5da6d769..99314032ec2 100644
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index 8ba281b4cfa..bab39cdf8a2 100644
index b88e1372005..82a7e25dd2f 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -946,7 +946,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value.
-param=ssp-buffer-size=
@ -48,6 +48,3 @@ index 8ba281b4cfa..bab39cdf8a2 100644
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.35.1

View file

@ -1,4 +1,4 @@
From c4dd51fe15a938fdd76d781a4eede2a9205eacbc Mon Sep 17 00:00:00 2001
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 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
@ -26,7 +26,7 @@ https://bugs.gentoo.org/295480
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index ab716ff04ea..e595268d9fc 100644
index 8f51544989e..5329804d136 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@ -38,10 +38,10 @@ index ab716ff04ea..e595268d9fc 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 8edd2e05639..63f61fcf96f 100644
index 243f3db7b72..822210781fa 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -553,6 +553,7 @@ uninstall-am:
@@ -561,6 +561,7 @@ uninstall-am:
.po.mo:
@ -49,6 +49,3 @@ index 8edd2e05639..63f61fcf96f 100644
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.35.1

View file

@ -1,4 +1,4 @@
From 0a1fd78184f00fb77dac00dabe98eb025620efc2 Mon Sep 17 00:00:00 2001
From 190064993cd8ddbd48015c1fc1916e4110a97733 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.
@ -8,7 +8,7 @@ Subject: [PATCH] Don't declare asprintf if defined as a macro.
1 file changed, 3 insertions(+)
diff --git a/include/libiberty.h b/include/libiberty.h
index f4c0fe11d6f..cf4b1043e4d 100644
index a65ced9c820..eb20ab0f95f 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@ -23,6 +23,3 @@ index f4c0fe11d6f..cf4b1043e4d 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.35.1

View file

@ -1,4 +1,4 @@
From f81d67f6fe1f1066642606209c882b333d937cb7 Mon Sep 17 00:00:00 2001
From 838e1daa955d9013c462be3471497cb39641e951 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
@ -8,10 +8,10 @@ Subject: [PATCH] libiberty: copy PIC objects during build process
1 file changed, 1 insertion(+)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 4f1213b983b..d0224649d30 100644
index 1b17c2e3a47..8db1176df2e 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -264,6 +264,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
@ -19,6 +19,3 @@ index 4f1213b983b..d0224649d30 100644
cd ..; \
else true; fi
--
2.35.1

View file

@ -1,4 +1,4 @@
From 3b732288ce771348cbcc9fb633a36b7aff2b4ad4 Mon Sep 17 00:00:00 2001
From 717346fbbd6642ba6b0c3af2deb3771794346507 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
@ -8,7 +8,7 @@ Subject: [PATCH] libitm: disable FORTIFY
1 file changed, 10 insertions(+)
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index a3d84896cc5..ecb281d5919 100644
index 06e90973ef3..669e64236c3 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -47,6 +47,16 @@ if test "$gcc_cv_have_tls" = yes ; then
@ -28,6 +28,3 @@ index a3d84896cc5..ecb281d5919 100644
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
case "${target_cpu}" in
--
2.35.1

View file

@ -1,33 +1,33 @@
From a3e556187d0a8e9d39544f023960eca0f07d3e83 Mon Sep 17 00:00:00 2001
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b 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
---
gcc/config/i386/i386-expand.c | 4 ++--
libgcc/config/i386/cpuinfo.c | 6 +++---
libgcc/config/i386/t-linux | 2 +-
gcc/config/i386/i386-expand.cc | 4 ++--
libgcc/config/i386/cpuinfo.c | 6 +++---
libgcc/config/i386/t-linux | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 1772fb16c9a..77e04b0c2df 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -11066,10 +11066,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 31780b6daf7..d89898846e1 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
- /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */
- /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init in libgcc.a. */
tree call_expr, fndecl, type;
type = build_function_type_list (integer_type_node, NULL_TREE);
type = build_function_type_list (integer_type_node, NULL_TREE);
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
call_expr = build_call_expr (fndecl, 0);
call_expr = build_call_expr (fndecl, 0);
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index ef463848f9d..1a3de052c80 100644
index dab1d98060f..cf824b4114a 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
@ -52,6 +52,3 @@ index 8506a635790..564296f788e 100644
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.35.1

View file

@ -1,4 +1,4 @@
From f520e67fba621f213146271408ff3210b3527176 Mon Sep 17 00:00:00 2001
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c 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
@ -9,10 +9,10 @@ Subject: [PATCH] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index 4b977e313b5..592e81e40f6 100755
index e9060112384..2f6b3265a6c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32300,6 +32300,33 @@ fi
@@ -32497,6 +32497,33 @@ fi
$as_echo "$gcc_cv_no_pie" >&6; }
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@ -47,10 +47,10 @@ index 4b977e313b5..592e81e40f6 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 5461bab88a9..1577529ffb7 100644
index 75a7048045c..e683d3a7a5f 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7571,6 +7571,19 @@ AC_CACHE_CHECK([for -no-pie option],
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
LDFLAGS="$saved_LDFLAGS"])
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@ -70,6 +70,3 @@ index 5461bab88a9..1577529ffb7 100644
fi
AC_SUBST([NO_PIE_FLAG])
--
2.35.1

View file

@ -1,4 +1,4 @@
From 26daa73d678b87a6950df1d79d171ba40ecbce15 Mon Sep 17 00:00:00 2001
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd 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
@ -8,7 +8,7 @@ Subject: [PATCH] dlang: use libucontext on mips64
1 file changed, 1 insertion(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 0643daeb613..b74d9fb3f25 100644
index 0063dd23249..c5e782a1238 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
@ -19,6 +19,3 @@ index 0643daeb613..b74d9fb3f25 100644
;;
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
--
2.35.1

View file

@ -1,25 +0,0 @@
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
---
libffi/src/closures.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libffi/src/closures.c b/libffi/src/closures.c
index 721ff00ea43..22a699c6340 100644
--- a/libffi/src/closures.c
+++ b/libffi/src/closures.c
@@ -34,7 +34,7 @@
#include <ffi_common.h>
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
+# if __linux__ && !defined(__ANDROID__)
/* This macro indicates it may be forbidden to map anonymous memory
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
--
2.35.1

View file

@ -1,4 +1,4 @@
From 374a19de60fcd5c31321c3f4d26dcc4b631e8c3f Mon Sep 17 00:00:00 2001
From fd642f8cd61849a9dc169588be5562ceda96a889 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
@ -8,7 +8,7 @@ Subject: [PATCH] ada: fix shared linking
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
index 5cd5ef64f56..1c611a82cab 100644
index a7574efb472..0ad0d66463c 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
@ -37,6 +37,3 @@ index 5cd5ef64f56..1c611a82cab 100644
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.35.1

View file

@ -1,425 +0,0 @@
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
---
libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++-----------
1 file changed, 196 insertions(+), 70 deletions(-)
diff --git a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
index e6cce240fd5..bd2fe37ebec 100644
--- a/libphobos/src/std/zlib.d
+++ b/libphobos/src/std/zlib.d
@@ -1,7 +1,7 @@
// Written in the D programming language.
/**
- * Compress/decompress data using the $(HTTP www._zlib.net, _zlib library).
+ * Compress/decompress data using the $(HTTP www.zlib.net, zlib library).
*
* Examples:
*
@@ -43,12 +43,12 @@
* References:
* $(HTTP en.wikipedia.org/wiki/Zlib, Wikipedia)
*
- * Copyright: Copyright Digital Mars 2000 - 2011.
+ * Copyright: Copyright The D Language Foundation 2000 - 2011.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(HTTP digitalmars.com, Walter Bright)
- * Source: $(PHOBOSSRC std/_zlib.d)
+ * Source: $(PHOBOSSRC std/zlib.d)
*/
-/* Copyright Digital Mars 2000 - 2011.
+/* Copyright The D Language Foundation 2000 - 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -75,9 +75,9 @@ enum
class ZlibException : Exception
{
- this(int errnum)
- { string msg;
-
+ private static string getmsg(int errnum) nothrow @nogc pure @safe
+ {
+ string msg;
switch (errnum)
{
case Z_STREAM_END: msg = "stream end"; break;
@@ -90,7 +90,12 @@ class ZlibException : Exception
case Z_VERSION_ERROR: msg = "version error"; break;
default: msg = "unknown error"; break;
}
- super(msg);
+ return msg;
+ }
+
+ this(int errnum)
+ {
+ super(getmsg(errnum));
}
}
@@ -104,7 +109,7 @@ class ZlibException : Exception
* buf = buffer containing input data
*
* Returns:
- * A $(D uint) checksum for the provided input data and starting checksum
+ * A `uint` checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Adler-32)
@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] buf)
* buf = buffer containing input data
*
* Returns:
- * A $(D uint) checksum for the provided input data and starting checksum
+ * A `uint` checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Cyclic_redundancy_check)
@@ -191,13 +196,14 @@ uint crc32(uint crc, const(void)[] buf)
ubyte[] compress(const(void)[] srcbuf, int level)
in
{
- assert(-1 <= level && level <= 9);
+ assert(-1 <= level && level <= 9, "Compression level needs to be within [-1, 9].");
}
-body
+do
{
import core.memory : GC;
+ import std.array : uninitializedArray;
auto destlen = srcbuf.length + ((srcbuf.length + 1023) / 1024) + 12;
- auto destbuf = new ubyte[destlen];
+ auto destbuf = uninitializedArray!(ubyte[])(destlen);
auto err = etc.c.zlib.compress2(destbuf.ptr, &destlen, cast(ubyte *) srcbuf.ptr, srcbuf.length, level);
if (err)
{
@@ -276,7 +282,7 @@ void[] uncompress(const(void)[] srcbuf, size_t destlen = 0u, int winbits = 15)
throw new ZlibException(err);
}
}
- assert(0);
+ assert(0, "Unreachable code");
}
@system unittest
@@ -370,9 +376,9 @@ class Compress
this(int level, HeaderFormat header = HeaderFormat.deflate)
in
{
- assert(1 <= level && level <= 9);
+ assert(1 <= level && level <= 9, "Legal compression level are in [1, 9].");
}
- body
+ do
{
this.level = level;
this.gzip = header == HeaderFormat.gzip;
@@ -406,6 +412,7 @@ class Compress
const(void)[] compress(const(void)[] buf)
{
import core.memory : GC;
+ import std.array : uninitializedArray;
int err;
ubyte[] destbuf;
@@ -420,7 +427,7 @@ class Compress
inited = 1;
}
- destbuf = new ubyte[zs.avail_in + buf.length];
+ destbuf = uninitializedArray!(ubyte[])(zs.avail_in + buf.length);
zs.next_out = destbuf.ptr;
zs.avail_out = to!uint(destbuf.length);
@@ -461,9 +468,10 @@ class Compress
void[] flush(int mode = Z_FINISH)
in
{
- assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH);
+ assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH,
+ "Mode must be either Z_FINISH, Z_SYNC_FLUSH or Z_FULL_FLUSH.");
}
- body
+ do
{
import core.memory : GC;
ubyte[] destbuf;
@@ -523,6 +531,7 @@ class UnCompress
z_stream zs;
int inited;
int done;
+ bool inputEnded;
size_t destbufsize;
HeaderFormat format;
@@ -571,16 +580,16 @@ class UnCompress
const(void)[] uncompress(const(void)[] buf)
in
{
- assert(!done);
+ assert(!done, "Buffer has been flushed.");
}
- body
+ do
{
+ if (inputEnded || !buf.length)
+ return null;
+
import core.memory : GC;
+ import std.array : uninitializedArray;
int err;
- ubyte[] destbuf;
-
- if (buf.length == 0)
- return null;
if (!inited)
{
@@ -598,26 +607,152 @@ class UnCompress
if (!destbufsize)
destbufsize = to!uint(buf.length) * 2;
- destbuf = new ubyte[zs.avail_in * 2 + destbufsize];
- zs.next_out = destbuf.ptr;
- zs.avail_out = to!uint(destbuf.length);
-
- if (zs.avail_in)
- buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf;
+ auto destbuf = uninitializedArray!(ubyte[])(destbufsize);
+ size_t destFill;
zs.next_in = cast(ubyte*) buf.ptr;
zs.avail_in = to!uint(buf.length);
- err = inflate(&zs, Z_NO_FLUSH);
- if (err != Z_STREAM_END && err != Z_OK)
+ while (true)
{
- GC.free(destbuf.ptr);
- error(err);
+ auto oldAvailIn = zs.avail_in;
+
+ zs.next_out = destbuf[destFill .. $].ptr;
+ zs.avail_out = to!uint(destbuf.length - destFill);
+
+ err = inflate(&zs, Z_NO_FLUSH);
+ if (err == Z_STREAM_END)
+ {
+ inputEnded = true;
+ break;
+ }
+ else if (err != Z_OK)
+ {
+ GC.free(destbuf.ptr);
+ error(err);
+ }
+ else if (!zs.avail_in)
+ break;
+
+ /*
+ According to the zlib manual inflate() stops when either there's
+ no more data to uncompress or the output buffer is full
+ So at this point, the output buffer is too full
+ */
+
+ destFill = destbuf.length;
+
+ if (destbuf.capacity)
+ {
+ if (destbuf.length < destbuf.capacity)
+ destbuf.length = destbuf.capacity;
+ else
+ {
+ auto newLength = GC.extend(destbuf.ptr, destbufsize, destbufsize);
+
+ if (newLength && destbuf.length < destbuf.capacity)
+ destbuf.length = destbuf.capacity;
+ else
+ destbuf.length += destbufsize;
+ }
+ }
+ else
+ destbuf.length += destbufsize;
}
+
destbuf.length = destbuf.length - zs.avail_out;
return destbuf;
}
+ // Test for issues 3191 and 9505
+ @system unittest
+ {
+ import std.algorithm.comparison;
+ import std.array;
+ import std.file;
+ import std.zlib;
+
+ // Data that can be easily compressed
+ ubyte[1024] originalData;
+
+ // This should yield a compression ratio of at least 1/2
+ auto compressedData = compress(originalData, 9);
+ assert(compressedData.length < originalData.length / 2,
+ "The compression ratio is too low to accurately test this situation");
+
+ auto chunkSize = compressedData.length / 4;
+ assert(chunkSize < compressedData.length,
+ "The length of the compressed data is too small to accurately test this situation");
+
+ auto decompressor = new UnCompress();
+ ubyte[originalData.length] uncompressedData;
+ ubyte[] reusedBuf;
+ int progress;
+
+ reusedBuf.length = chunkSize;
+
+ for (int i = 0; i < compressedData.length; i += chunkSize)
+ {
+ auto len = min(chunkSize, compressedData.length - i);
+ // simulate reading from a stream in small chunks
+ reusedBuf[0 .. len] = compressedData[i .. i + len];
+
+ // decompress using same input buffer
+ auto chunk = decompressor.uncompress(reusedBuf);
+ assert(progress + chunk.length <= originalData.length,
+ "The uncompressed result is bigger than the original data");
+
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
+ progress += chunk.length;
+ }
+
+ auto chunk = decompressor.flush();
+ assert(progress + chunk.length <= originalData.length,
+ "The uncompressed result is bigger than the original data");
+
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
+ progress += chunk.length;
+
+ assert(progress == originalData.length,
+ "The uncompressed and the original data sizes differ");
+ assert(originalData[] == uncompressedData[],
+ "The uncompressed and the original data differ");
+ }
+
+ @system unittest
+ {
+ ubyte[1024] invalidData;
+ auto decompressor = new UnCompress();
+
+ try
+ {
+ auto uncompressedData = decompressor.uncompress(invalidData);
+ }
+ catch (ZlibException e)
+ {
+ assert(e.msg == "data error");
+ return;
+ }
+
+ assert(false, "Corrupted data didn't result in an error");
+ }
+
+ @system unittest
+ {
+ ubyte[2014] originalData = void;
+ auto compressedData = compress(originalData, 9);
+
+ auto decompressor = new UnCompress();
+ auto uncompressedData = decompressor.uncompress(compressedData ~ cast(ubyte[]) "whatever");
+
+ assert(originalData.length == uncompressedData.length,
+ "The uncompressed and the original data sizes differ");
+ assert(originalData[] == uncompressedData[],
+ "The uncompressed and the original data differ");
+ assert(!decompressor.uncompress("whatever").length,
+ "Compression continued after the end");
+ }
+
/**
* Decompress and return any remaining data.
* The returned data should be appended to that returned by uncompress().
@@ -626,49 +761,40 @@ class UnCompress
void[] flush()
in
{
- assert(!done);
+ assert(!done, "Buffer has been flushed before.");
}
out
{
- assert(done);
+ assert(done, "Flushing failed.");
}
- body
+ do
{
- import core.memory : GC;
- ubyte[] extra;
- ubyte[] destbuf;
- int err;
-
done = 1;
- if (!inited)
- return null;
+ return null;
+ }
- L1:
- destbuf = new ubyte[zs.avail_in * 2 + 100];
- zs.next_out = destbuf.ptr;
- zs.avail_out = to!uint(destbuf.length);
+ /// Returns true if all input data has been decompressed and no further data
+ /// can be decompressed (inflate() returned Z_STREAM_END)
+ @property bool empty() const
+ {
+ return inputEnded;
+ }
- err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH);
- if (err == Z_OK && zs.avail_out == 0)
- {
- extra ~= destbuf;
- goto L1;
- }
- if (err != Z_STREAM_END)
- {
- GC.free(destbuf.ptr);
- if (err == Z_OK)
- err = Z_BUF_ERROR;
- error(err);
- }
- destbuf = destbuf.ptr[0 .. zs.next_out - destbuf.ptr];
- err = etc.c.zlib.inflateEnd(&zs);
- inited = 0;
- if (err)
- error(err);
- if (extra.length)
- destbuf = extra ~ destbuf;
- return destbuf;
+ ///
+ @system unittest
+ {
+ // some random data
+ ubyte[1024] originalData = void;
+
+ // append garbage data (or don't, this works in both cases)
+ auto compressedData = cast(ubyte[]) compress(originalData) ~ cast(ubyte[]) "whatever";
+
+ auto decompressor = new UnCompress();
+ auto uncompressedData = decompressor.uncompress(compressedData);
+
+ assert(uncompressedData[] == originalData[],
+ "The uncompressed and the original data differ");
+ assert(decompressor.empty, "The UnCompressor reports not being done");
}
}
--
2.35.1

View file

@ -1,4 +1,4 @@
From ad053bc46b535e78397f992e3c2c1d28c1ebd1f4 Mon Sep 17 00:00:00 2001
From a547632f5c7caec4a164e8d5e5b568fb7a461365 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
@ -8,10 +8,10 @@ Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 047be0255e2..426949aa91c 100644
index 593495e1650..b96f60e33e2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -170,6 +170,7 @@ BUILD_EXPORTS = \
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
# built for the build system to override those in BASE_FLAGS_TO_PASS.
EXTRA_BUILD_FLAGS = \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
@ -19,6 +19,3 @@ index 047be0255e2..426949aa91c 100644
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
--
2.35.1

View file

@ -1,4 +1,4 @@
From 18d44a7f8d801cc6926a73e2dda2f0ce859dc561 Mon Sep 17 00:00:00 2001
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d 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
@ -8,10 +8,10 @@ Subject: [PATCH] add fortify-headers paths
1 file changed, 2 insertions(+)
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 4e1db60fced..7fcf402b416 100644
index 74f70793d90..61b07f319f6 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -167,6 +167,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
@ -20,6 +20,3 @@ index 4e1db60fced..7fcf402b416 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.35.1

View file

@ -1,38 +0,0 @@
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
---
libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
index 59df921ba41..9ee9f943948 100644
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
@@ -871,6 +871,21 @@ else version (CRuntime_Musl)
F_SETLKW = 7,
}
}
+ else version (MIPS_Any)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x008000, // octal 0100000
+ O_LARGEFILE = 0x002000, // octal 0020000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 33,
+ F_SETLK = 34,
+ F_SETLKW = 35,
+ }
+ }
else
static assert(0, "Platform not supported");
--
2.35.1

View file

@ -1,4 +1,4 @@
From 38d27ebdcc5a8bea0807b5d56203f0ea5e16868f Mon Sep 17 00:00:00 2001
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 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
@ -9,14 +9,14 @@ Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
stack-protector flag usage.
---
gcc/gcc.c | 3 +--
gcc/gcc.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 99314032ec2..6e91767efe8 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -997,8 +997,7 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index cc99d0b7aa1..c60a75371f8 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
@ -26,6 +26,3 @@ index 99314032ec2..6e91767efe8 100644
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.35.1

View file

@ -1,18 +1,18 @@
From 0cc2a1befaf343e5ce1cbc15bd247eee812bdf33 Mon Sep 17 00:00:00 2001
From bbd5c529ef878c2d6096fd4949616714eb82683a 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
linking libtsan.
---
gcc/gcc.c | 16 ++++++++--------
gcc/gcc.cc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 6e91767efe8..22dbbf85850 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -738,10 +738,10 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c60a75371f8..735b2b1bba1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -745,10 +745,10 @@ proper position among the other output files. */
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
@ -25,7 +25,7 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -777,10 +777,10 @@ proper position among the other output files. */
@@ -784,10 +784,10 @@ proper position among the other output files. */
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
@ -38,7 +38,7 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -798,10 +798,10 @@ proper position among the other output files. */
@@ -805,10 +805,10 @@ proper position among the other output files. */
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
@ -51,7 +51,7 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -817,10 +817,10 @@ proper position among the other output files. */
@@ -824,10 +824,10 @@ proper position among the other output files. */
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
@ -64,6 +64,3 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.35.1

View file

@ -1,4 +1,4 @@
From feea6f782e83a53487ad633608484dfa3483be1b Mon Sep 17 00:00:00 2001
From 714ed6d9649bf9ed42e34fef9c41169921e63921 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
@ -10,10 +10,10 @@ multilib is not supported by Alpine GCC
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 47aac9d3d61..4ad81059a86 100644
index 858bbba3a36..2d4f553e652 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3425,11 +3425,11 @@ struct GTY(()) machine_function {
@@ -3447,11 +3447,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
@ -30,7 +30,7 @@ index 47aac9d3d61..4ad81059a86 100644
/* Load store bonding is not supported by micromips and fix_24k. The
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 130e1f04707..a64ac2bbb5b 100644
index 2fdd8e00407..406a3676289 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
@ -43,6 +43,3 @@ index 130e1f04707..a64ac2bbb5b 100644
+ ../lib \
+ ../lib32 \
+ ../lib
--
2.35.1

View file

@ -1,4 +1,4 @@
From cbd96a32dc2aaa61f6adcb3643e1da21f185f80e Mon Sep 17 00:00:00 2001
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b 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
@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
index 241b0ef20b6..18e63b34d8b 100644
index d0cd546002a..b63a77f4969 100644
--- a/gcc/config/aarch64/t-aarch64-linux
+++ b/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
@ -21,6 +21,3 @@ index 241b0ef20b6..18e63b34d8b 100644
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.35.1

View file

@ -1,4 +1,4 @@
From e87e415e9a88dbce68ed7b9d8386c3c2d0c0d6b6 Mon Sep 17 00:00:00 2001
From 65ad898df141261a1ccd891a99133ad8f9847133 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
@ -20,6 +20,3 @@ index cc6ab367072..7f498ee1cdc 100644
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.35.1

View file

@ -1,4 +1,4 @@
From 5c24869c9bc1a552f8bb5c32a8538c6e065a4db8 Mon Sep 17 00:00:00 2001
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be 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
@ -12,7 +12,7 @@ multilib is not presently supported on Alpine GCC
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
index aeb7440c492..ab14c455d8d 100644
index 4e371255533..128c75c7d39 100644
--- a/gcc/config/rs6000/t-linux
+++ b/gcc/config/rs6000/t-linux
@@ -2,7 +2,8 @@
@ -36,7 +36,7 @@ index aeb7440c492..ab14c455d8d 100644
endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index e11a118cb5f..df81dc04a32 100644
index 47e0efd5764..f89729af64f 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
@ -48,7 +48,7 @@ index e11a118cb5f..df81dc04a32 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc
$(COMPILE) $<
diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele
index 97c1ee6fb4d..08d72639cb6 100644
@ -76,6 +76,3 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.35.1

View file

@ -1,4 +1,4 @@
From 25927f8106583ee594e7bcdf92dd1387e0fd024c Mon Sep 17 00:00:00 2001
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 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
@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index d288b093522..2949033aa04 100644
index 5526ad0e6cc..78866afab36 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -33,6 +33,6 @@
@ -21,6 +21,3 @@ index d288b093522..2949033aa04 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.35.1

View file

@ -1,4 +1,4 @@
From 18bcf23cae4069ffe9d9f64e851193d29dd4814f Mon Sep 17 00:00:00 2001
From 2eed19787020ce52cf07b76a5d167c420ec42b61 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
@ -43,7 +43,7 @@ library.
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index ee29979dd34..fe8a82d6702 100644
index 3067ed6eac8..4c8c85e3285 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
@ -69,6 +69,3 @@ index 216d2776a18..1a8a863853e 100644
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.35.1

View file

@ -1,4 +1,4 @@
From a46c8d6cb9428db29fbf8a80609ff449354ce111 Mon Sep 17 00:00:00 2001
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a 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
@ -10,7 +10,7 @@ highly inspired by:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 2c8be561eb5..c557750b1b3 100644
index 09b3ec8bc2e..c9ca58c64cc 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
@ -46,6 +46,3 @@ index 2c8be561eb5..c557750b1b3 100644
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.35.1

View file

@ -1,4 +1,4 @@
From d7064ab25a561bb99c3d0b35663154656013aed2 Mon Sep 17 00:00:00 2001
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 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
@ -9,10 +9,10 @@ Subject: [PATCH] ada: libgnarl compatibility for musl
2 files changed, 3 insertions(+), 61 deletions(-)
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
index 2272f83d68d..1d78456544a 100644
index 7c9e7ca4518..caafc4aa68f 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -401,12 +401,6 @@ package System.OS_Interface is
@@ -403,12 +403,6 @@ package System.OS_Interface is
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
@ -25,7 +25,7 @@ index 2272f83d68d..1d78456544a 100644
function pthread_rwlock_init
(mutex : access pthread_rwlock_t;
attr : access pthread_rwlockattr_t) return int;
@@ -468,11 +462,6 @@ package System.OS_Interface is
@@ -470,11 +464,6 @@ package System.OS_Interface is
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
@ -38,7 +38,7 @@ index 2272f83d68d..1d78456544a 100644
sched_priority : int; -- scheduling priority
end record;
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 757a6cdfdad..82df94f6a00 100644
index 4ff784f0ea7..b34a12802c6 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
@ -130,6 +130,3 @@ index 757a6cdfdad..82df94f6a00 100644
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
--
2.35.1

View file

@ -1,4 +1,4 @@
From 5193de0a6c96fefe0c46fc9a6b8c27623ad85640 Mon Sep 17 00:00:00 2001
From 82addb1312f4f58a412a664228944009aa5cb569 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,10 +11,10 @@ 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 b5b8b573ea4..6fce40d1e98 100644
index aaf853e3a2a..e2dd3587ed5 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))),)
@@ -1633,7 +1633,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -23,7 +23,7 @@ index b5b8b573ea4..6fce40d1e98 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2355,7 +2355,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2258,7 +2258,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -32,7 +32,7 @@ index b5b8b573ea4..6fce40d1e98 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2386,7 +2386,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2289,7 +2289,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@ -41,7 +41,7 @@ index b5b8b573ea4..6fce40d1e98 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2597,7 +2597,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2504,7 +2504,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -50,7 +50,7 @@ index b5b8b573ea4..6fce40d1e98 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2700,7 +2700,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2608,7 +2608,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) \
@ -60,7 +60,7 @@ index b5b8b573ea4..6fce40d1e98 100644
$(X86_64_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 2e54e69643a..e7e6507e2e0 100644
index 591d033fbca..a485cbf15b9 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@ -75,7 +75,7 @@ index 2e54e69643a..e7e6507e2e0 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3442,7 +3447,6 @@ __gnat_lwp_self (void)
@@ -3446,7 +3451,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@ -83,7 +83,7 @@ index 2e54e69643a..e7e6507e2e0 100644
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
@@ -3452,7 +3456,7 @@ __gnat_lwp_self (void)
@@ -3456,7 +3460,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@ -92,7 +92,7 @@ index 2e54e69643a..e7e6507e2e0 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3465,33 +3469,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3469,33 +3473,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@ -134,7 +134,7 @@ index 2e54e69643a..e7e6507e2e0 100644
}
size_t
@@ -3501,23 +3505,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3505,23 +3509,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@ -164,10 +164,10 @@ index 2e54e69643a..e7e6507e2e0 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 85997b9ba68..fd10e5b5589 100644
index 2631be5ad3e..d442f4bd6cd 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -325,13 +325,11 @@ extern void *__gnat_lwp_self (void);
@@ -321,13 +321,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@ -186,7 +186,7 @@ index 85997b9ba68..fd10e5b5589 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index ec9db3a6a4c..6f92e50dd67 100644
index 32d30a49c7e..d960e32e2d0 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@ -218,6 +218,3 @@ index ec9db3a6a4c..6f92e50dd67 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.35.1

View file

@ -1,4 +1,4 @@
From 8a42d93247c375f199f3079538d659f95b9ff2a0 Mon Sep 17 00:00:00 2001
From 7feb681596c4cfa34c769505058aa5bdf31c5131 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
@ -8,14 +8,14 @@ Content-Transfer-Encoding: 8bit
Taken from Adélie Linux.
---
libgo/mksigtab.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
libgo/mksigtab.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
index 11e4ec436bd..fe866eacb27 100644
index bea8739957e..3876002efab 100644
--- a/libgo/mksigtab.sh
+++ b/libgo/mksigtab.sh
@@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}'
@@ -86,7 +86,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}'
checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}'
checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}'
checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}'
@ -24,20 +24,3 @@ index 11e4ec436bd..fe866eacb27 100644
checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
checksig _SIGLWP '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
checksig _SIGFREEZE '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
@@ -95,10 +95,12 @@ checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
# Special handling of signals 32 and 33 on GNU/Linux systems,
# because they are special to glibc.
+# Signal 34 is additionally special to Linux systems with musl.
if test "${GOOS}" = "linux"; then
- SIGLIST=$SIGLIST"_32__33_"
+ SIGLIST=$SIGLIST"_32__33__34_"
echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
+ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
fi
if test "${GOOS}" = "aix"; then
--
2.35.1

View file

@ -1,4 +1,4 @@
From c205f79c18add13247a06cfd843f5eb44c4c3cb4 Mon Sep 17 00:00:00 2001
From b6885cf73989161b1b6893b5ae0dafed006d5f13 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
@ -22,6 +22,3 @@ index 0c52ea5d71a..6fef104cc1c 100755
if test "${GOOS}" = "netbsd"; then
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi
--
2.35.1

View file

@ -1,4 +1,4 @@
From 6e41b6753af412388e9259fe791904146695e84e Mon Sep 17 00:00:00 2001
From c7a22e42ae403154a0c0158495b04b0205102041 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
@ -8,7 +8,7 @@ Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c
1 file changed, 4 insertions(+)
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 38bf7a6b255..e50403b5a75 100644
index 3a30748d329..a987678fa84 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -66,6 +66,10 @@ static void gscanstack(G*);
@ -22,6 +22,3 @@ index 38bf7a6b255..e50403b5a75 100644
#ifndef SETCONTEXT_CLOBBERS_TLS
static inline void
--
2.35.1

View file

@ -1,4 +1,4 @@
From cc89c078ffc58a7f6675a60fbca24224effcb7e3 Mon Sep 17 00:00:00 2001
From ef9df74e0c1059e51bb76b1f6d9d4746949d4d34 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
@ -8,10 +8,10 @@ Subject: [PATCH] gcc-go: link to libucontext
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 426949aa91c..f97db1ef569 100644
index b96f60e33e2..b564ddbf792 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -50331,7 +50331,7 @@ configure-target-libgo:
@@ -52802,7 +52802,7 @@ configure-target-libgo:
esac; \
module_srcdir=libgo; \
rm -f no-such-file || : ; \
@ -20,6 +20,3 @@ index 426949aa91c..f97db1ef569 100644
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.35.1

View file

@ -1,4 +1,4 @@
From 3fb914ca83ac18287ee24aa75aba9149e35487ad Mon Sep 17 00:00:00 2001
From 5093aa99f9cdded2e1ddf67b7139da6fac36b0a6 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
@ -43,6 +43,3 @@ index 5b19e6f202d..8dc60172186 100644
package syscall
--
2.35.1

View file

@ -1,4 +1,4 @@
From 52ce9c86c0c89ae45e0d08cc232682e1811aa8f2 Mon Sep 17 00:00:00 2001
From 573a66e4146c9a65d895af9081a4d3d49cfc9e7a 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
@ -9,19 +9,19 @@ This fixes issues with RISC-V.
Makefile.in | 1 +
gcc/config.in | 6 ++++++
gcc/config/gnu-user.h | 12 +++++++++++-
gcc/configure | 34 +++++++++++++++++++++++++++++++---
gcc/configure | 32 ++++++++++++++++++++++++++++++--
gcc/configure.ac | 22 +++++++++++++++++++++-
gcc/doc/install.texi | 8 ++++++++
gcc/doc/tm.texi | 8 +++++++-
gcc/doc/tm.texi.in | 8 +++++++-
gcc/gcc.c | 12 +++++++++++-
9 files changed, 103 insertions(+), 8 deletions(-)
gcc/gcc.cc | 12 +++++++++++-
9 files changed, 102 insertions(+), 7 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index f97db1ef569..7e577ed3dbb 100644
index b564ddbf792..a95c7407d16 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -222,6 +222,7 @@ HOST_EXPORTS = \
@@ -232,6 +232,7 @@ HOST_EXPORTS = \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@ -30,10 +30,10 @@ index f97db1ef569..7e577ed3dbb 100644
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
diff --git a/gcc/config.in b/gcc/config.in
index 059c818c895..2a560417440 100644
index f0fbf123aa8..af84efc4f9e 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -106,6 +106,12 @@
@@ -118,6 +118,12 @@
#endif
@ -47,7 +47,7 @@ index 059c818c895..2a560417440 100644
format instead of DPD */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 902378e1bad..daf7727a01a 100644
index 8433e56c3e1..0347f10da8b 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -71,10 +71,10 @@ index 902378e1bad..daf7727a01a 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/configure b/gcc/configure
index 592e81e40f6..8672298f23f 100755
index 2f6b3265a6c..6dc65bf4ccb 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -978,6 +978,7 @@ with_changes_root_url
@@ -981,6 +981,7 @@ with_changes_root_url
enable_languages
with_multilib_list
with_multilib_generator
@ -82,7 +82,7 @@ index 592e81e40f6..8672298f23f 100755
with_zstd
with_zstd_include
with_zstd_lib
@@ -1707,6 +1708,9 @@ Optional Features:
@@ -1710,6 +1711,9 @@ Optional Features:
--disable-shared don't provide a shared libgcc
--disable-gcov don't provide libgcov and related host tools
--enable-languages=LIST specify which front-ends to build
@ -92,7 +92,7 @@ index 592e81e40f6..8672298f23f 100755
--disable-rpath do not hardcode runtime library paths
--enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling
@@ -8070,7 +8074,6 @@ else
@@ -8324,7 +8328,6 @@ else
fi
@ -100,7 +100,7 @@ index 592e81e40f6..8672298f23f 100755
# Check whether --with-multilib-generator was given.
if test "${with_multilib_generator+set}" = set; then :
withval=$with_multilib_generator; :
@@ -8078,6 +8081,32 @@ else
@@ -8332,6 +8335,32 @@ else
with_multilib_generator=default
fi
@ -133,25 +133,16 @@ index 592e81e40f6..8672298f23f 100755
# -------------------------
# Checks for other programs
@@ -19501,7 +19530,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19501 "configure"
+#line 19158 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -34068,4 +34097,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
@@ -34296,4 +34325,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 1577529ffb7..e96691f69ba 100644
index e683d3a7a5f..07c81c78336 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1149,6 +1149,27 @@ AC_ARG_WITH(multilib-generator,
@@ -1205,6 +1205,27 @@ AC_ARG_WITH(multilib-generator,
:,
with_multilib_generator=default)
@ -179,16 +170,16 @@ index 1577529ffb7..e96691f69ba 100644
# -------------------------
# Checks for other programs
# -------------------------
@@ -7729,4 +7750,3 @@ done
@@ -7839,4 +7860,3 @@ done
],
[subdirs='$subdirs'])
AC_OUTPUT
-
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 4c38244ae58..4a544e6a4ee 100644
index 48408d842db..c90be0ee750 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2213,6 +2213,14 @@ files, but these changed header paths may conflict with some compilation
@@ -2295,6 +2295,14 @@ files, but these changed header paths may conflict with some compilation
environments. Enabled by default, and may be disabled using
@option{--disable-canonical-system-headers}.
@ -204,7 +195,7 @@ index 4c38244ae58..4a544e6a4ee 100644
Tell GCC that when the GNU C Library (glibc) is used on the target it
will be version @var{major}.@var{minor} or later. Normally this can
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b370bc76b25..acc78273983 100644
index c5006afc00d..56b62c69ae8 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -223,7 +214,7 @@ index b370bc76b25..acc78273983 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 2974dae2701..80e003a38ce 100644
index f869ddd5e5b..57c93f24ac3 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -241,11 +232,11 @@ index 2974dae2701..80e003a38ce 100644
@end defmac
@defmac POST_LINK_SPEC
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 22dbbf85850..90aa576037a 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -980,13 +980,23 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 735b2b1bba1..f10f3c91aa7 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,13 +987,23 @@ proper position among the other output files. */
# define ASM_DEBUG_OPTION_SPEC ""
#endif
@ -270,6 +261,3 @@ index 22dbbf85850..90aa576037a 100644
#endif
#ifdef ENABLE_DEFAULT_SSP
--
2.35.1

View file

@ -1,29 +0,0 @@
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
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Taken from Adélie Linux.
---
libgo/go/runtime/signal_gccgo.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgo/go/runtime/signal_gccgo.go b/libgo/go/runtime/signal_gccgo.go
index 2eece687e35..e86490ce203 100644
--- a/libgo/go/runtime/signal_gccgo.go
+++ b/libgo/go/runtime/signal_gccgo.go
@@ -106,7 +106,7 @@ func getsig(i uint32) uintptr {
if sigaction(i, nil, &sa) < 0 {
// On GNU/Linux glibc rejects attempts to call
// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
- if GOOS == "linux" && (i == 32 || i == 33) {
+ if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
return _SIG_DFL
}
throw("sigaction read failure")
--
2.35.1

View file

@ -1,4 +1,4 @@
From 5010fa237897bca92291ba8835123125d4af933a Mon Sep 17 00:00:00 2001
From 4baaeb9661fa4015d9701e3616ce1ad4e8a07fd8 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
@ -22,7 +22,7 @@ See:
1 file changed, 20 insertions(+)
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index 670b0d72cfe..38c2cd9345f 100644
index 33f8c91ce77..3999db2cf8a 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -30,6 +30,26 @@
@ -52,6 +52,3 @@ index 670b0d72cfe..38c2cd9345f 100644
case "${target_cpu}" in
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.35.1

View file

@ -1,4 +1,4 @@
From 2d924c522dde7426afbb8096d9301b17d0e73121 Mon Sep 17 00:00:00 2001
From 4655244d80aa67904a88d620361f2d37ea4c8576 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
@ -18,7 +18,7 @@ it include fcntl.h which defines loff_t on musl.
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/libgo/configure b/libgo/configure
index 70f64c974fd..69d15839e8c 100755
index ffe17c9be55..c2dbecef98c 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -15546,7 +15546,9 @@ _ACEOF
@ -33,10 +33,10 @@ index 70f64c974fd..69d15839e8c 100755
cat >>confdefs.h <<_ACEOF
diff --git a/libgo/configure.ac b/libgo/configure.ac
index ebab9d9de3e..a3d9d309aba 100644
index 7e2b98ba67c..667feae3c03 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -602,7 +602,9 @@ AC_STRUCT_DIRENT_D_TYPE
@@ -601,7 +601,9 @@ AC_STRUCT_DIRENT_D_TYPE
AC_CHECK_FUNCS(accept4 dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat open64 openat pipe2 removexattr renameat setxattr sync_file_range splice syscall tee unlinkat unshare utimensat)
AC_TYPE_OFF_T
@ -79,6 +79,3 @@ index 8ce061e2f5f..b85add15a7b 100644
// SIOCGIFMTU can't be added in the above enum as it might
// be signed in some OSes.
#ifdef SIOCGIFMTU
--
2.35.1

View file

@ -1,4 +1,4 @@
From 36c79820c1085590f272ef1afcad4744125d96d0 Mon Sep 17 00:00:00 2001
From 76c13560bba3534bff335e5bb571a8b95d50d4ba 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
@ -58,6 +58,3 @@ index fa3389d857e..57bed97c710 100644
p := sysMmap(addr, n, prot, flags, fd, off)
if uintptr(p) == _MAP_FAILED {
return nil, errno()
--
2.35.1

View file

@ -1,4 +1,4 @@
From 353c8abdc34a294c89c24423ef0c4182189117f6 Mon Sep 17 00:00:00 2001
From cf41d579088e1c0b5c33c93657ad041e797b5905 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
@ -37,7 +37,7 @@ Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
1 file changed, 6 insertions(+)
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index d30d1603adc..fc01e04e4a1 100644
index 528d9b6d9fe..c67503f0a79 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -10,6 +10,12 @@
@ -53,6 +53,3 @@ index d30d1603adc..fc01e04e4a1 100644
#include "runtime.h"
#ifndef SA_RESTART
--
2.35.1

View file

@ -1,4 +1,4 @@
From dba87d9796b61f4f3eea83c200a2d208564e2277 Mon Sep 17 00:00:00 2001
From fbc8240ac15225ede8416a27c9978559b85d6877 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
@ -6,13 +6,13 @@ 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 +++--
gcc/go/gospec.cc | 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
diff --git a/gcc/go/gospec.cc b/gcc/go/gospec.cc
index df92b62d8e6..cf168beb4cf 100644
--- a/gcc/go/gospec.cc
+++ b/gcc/go/gospec.cc
@@ -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++];
@ -28,6 +28,3 @@ index cf8d0f2b60e..d5bfa57ea45 100644
if (is_m64)
supports_split_stack = 1;
#endif
--
2.35.1

View file

@ -1,80 +0,0 @@
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
This moves usages of pthread.h to above any usage of system.h as it
included #pragma GCC poison calloc
---
gcc/jit/jit-playback.c | 4 ++--
gcc/jit/jit-recording.c | 4 ++--
gcc/jit/libgccjit.c | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
index cee9daa8220..a5600084933 100644
--- a/gcc/jit/jit-playback.c
+++ b/gcc/jit/jit-playback.c
@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -41,8 +43,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "stmt.h"
-#include <pthread.h>
-
#include "jit-playback.h"
#include "jit-result.h"
#include "jit-builtins.h"
diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c
index 117ff70114c..d2634a546b1 100644
--- a/gcc/jit/jit-recording.c
+++ b/gcc/jit/jit-recording.c
@@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -25,8 +27,6 @@ along with GCC; see the file COPYING3. If not see
#include "pretty-print.h"
#include "toplev.h"
-#include <pthread.h>
-
#include "jit-builtins.h"
#include "jit-recording.h"
#include "jit-playback.h"
diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
index 0cc650f9810..2f44481eeb0 100644
--- a/gcc/jit/libgccjit.c
+++ b/gcc/jit/libgccjit.c
@@ -18,13 +18,14 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <pthread.h>
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "timevar.h"
#include "typed-splay-tree.h"
#include "cppbuiltin.h"
-#include <pthread.h>
#include "libgccjit.h"
#include "jit-recording.h"
--
2.35.1

View file

@ -0,0 +1,31 @@
From 38270192ea355d8035d9f1b5fe50e36ca3fa3708 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 30 Jun 2022 17:04:23 +0000
Subject: [PATCH] gcc-go: fix build error with SYS_SECCOMP
fix the build error:
sysinfo.go:6606:7: error: redefinition of 'SYS_SECCOMP'
6606 | const SYS_SECCOMP = _SYS_SECCOMP
| ^
sysinfo.go:6600:7: note: previous definition of 'SYS_SECCOMP' was here
6600 | const SYS_SECCOMP = _SYS_seccomp
| ^
Upstream report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105225
---
libgo/mksysinfo.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 6fef104cc1c..06289a43bdf 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -126,7 +126,7 @@ if ! grep '^const SIGCLD ' ${OUT} >/dev/null 2>&1; then
fi
# The syscall numbers. We force the names to upper case.
-grep '^const _SYS_' gen-sysinfo.go | \
+grep '^const _SYS_[a-z]' gen-sysinfo.go | \
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
while read sys; do
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`

View file

@ -0,0 +1,24 @@
From 20c84de53efcb86993f1a1909e65a97240d6123e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 30 Jun 2022 17:08:36 +0000
Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl
targets
---
libstdc++-v3/config/locale/generic/c_locale.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index 1e4db8d4415..9b79bc3c5dd 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Currently, the generic model only supports the "C" locale.
// See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html
__cloc = 0;
- if (strcmp(__s, "C"))
- __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
- "name not valid"));
}
void

View file

@ -1,106 +0,0 @@
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
The stddef.h header checks/sets various hardcoded toolchain/os specific
macro guards to prevent redefining types such as ptrdiff_t, wchar_t, or
size_t. However, without this patch, the file does not check/set the
typedef macro guards for musl libc. This causes types such as size_t to
be defined twice for files which include both musl's stddef.h as well as
GCC's ginclude/stddef.h. This is, for example, the case for
libgo/sysinfo.c. If libgo/sysinfo.c has multiple typedefs for size_t
this confuses -fdump-go-spec and causes size_t not to be included in the
generated type definitions thereby causing a gcc-go compilation failure
on musl with the following error message:
sysinfo.go:7765:13: error: use of undefined type '_size_t'
7765 | type Size_t _size_t
| ^
libcall_posix.go:49:35: error: non-integer len argument in make
49 | b := make([]byte, len)
|
This commit fixes this issue by ensuring that ptrdiff_t, wchar_t, and size_t
are only defined once in the pre-processed libgo/sysinfo.c file by enhancing
gcc/ginclude/stddef.h with musl-specific typedef macro guards.
---
gcc/ginclude/stddef.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index 66619fe43b1..50d710a5ab9 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -128,6 +128,7 @@ _TYPE_wchar_t;
#ifndef ___int_ptrdiff_t_h
#ifndef _GCC_PTRDIFF_T
#ifndef _PTRDIFF_T_DECLARED /* DragonFly */
+#ifndef __DEFINED_ptrdiff_t /* musl libc */
#define _PTRDIFF_T
#define _T_PTRDIFF_
#define _T_PTRDIFF
@@ -137,10 +138,12 @@ _TYPE_wchar_t;
#define ___int_ptrdiff_t_h
#define _GCC_PTRDIFF_T
#define _PTRDIFF_T_DECLARED
+#define __DEFINED_ptrdiff_t
#ifndef __PTRDIFF_TYPE__
#define __PTRDIFF_TYPE__ long int
#endif
typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif /* __DEFINED_ptrdiff_t */
#endif /* _PTRDIFF_T_DECLARED */
#endif /* _GCC_PTRDIFF_T */
#endif /* ___int_ptrdiff_t_h */
@@ -174,6 +177,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#ifndef _SIZE_T_DEFINED
#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
+#ifndef __DEFINED_size_t /* musl libc */
#ifndef ___int_size_t_h
#ifndef _GCC_SIZE_T
#ifndef _SIZET_
@@ -191,6 +195,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#define _SIZE_T_DEFINED
#define _BSD_SIZE_T_DEFINED_ /* Darwin */
#define _SIZE_T_DECLARED /* FreeBSD 5 */
+#define __DEFINED_size_t /* musl libc */
#define ___int_size_t_h
#define _GCC_SIZE_T
#define _SIZET_
@@ -215,6 +220,7 @@ typedef long ssize_t;
#endif /* _SIZET_ */
#endif /* _GCC_SIZE_T */
#endif /* ___int_size_t_h */
+#endif /* __DEFINED_size_t */
#endif /* _SIZE_T_DECLARED */
#endif /* _BSD_SIZE_T_DEFINED_ */
#endif /* _SIZE_T_DEFINED */
@@ -251,6 +257,7 @@ typedef long ssize_t;
#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
+#ifndef __DEFINED_wchar_t /* musl libc */
#ifndef _WCHAR_T_DEFINED_
#ifndef _WCHAR_T_DEFINED
#ifndef _WCHAR_T_H
@@ -272,6 +279,7 @@ typedef long ssize_t;
#define __INT_WCHAR_T_H
#define _GCC_WCHAR_T
#define _WCHAR_T_DECLARED
+#define __DEFINED_wchar_t
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
@@ -326,6 +334,7 @@ typedef __WCHAR_TYPE__ wchar_t;
#endif
#endif
#endif
+#endif /* __DEFINED_wchar_t */
#endif /* _WCHAR_T_DECLARED */
#endif /* _BSD_RUNE_T_DEFINED_ */
#endif
--
2.35.1

View file

@ -1,4 +1,4 @@
From e74e2946a534fbac7e8ec6c687c407761daef49a Mon Sep 17 00:00:00 2001
From b6554d1207d0f5771c2f5d11316b61787e4dd705 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
@ -9,10 +9,10 @@ ref: alpine/aports#13422
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 7e577ed3dbb..da40b61a8c5 100644
index a95c7407d16..ea942d60387 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -51248,7 +51248,7 @@ configure-target-libphobos:
@@ -53287,7 +53287,7 @@ configure-target-libphobos:
esac; \
module_srcdir=libphobos; \
rm -f no-such-file || : ; \
@ -21,6 +21,3 @@ index 7e577ed3dbb..da40b61a8c5 100644
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.35.1

View file

@ -0,0 +1,51 @@
From 39f5c9a850917a3c19630c0115ef0d5b0f151c72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 16 Jul 2022 13:26:49 +0200
Subject: [PATCH] druntime: link against libucontext on all platforms
On musl-based Linux distributions, swapcontext etc. are not provided by
musl but instead by libucontext. Hence, we _always_ need to link against
an external library for these functions.
---
libphobos/configure | 8 --------
libphobos/m4/druntime/libraries.m4 | 8 --------
2 files changed, 16 deletions(-)
diff --git a/libphobos/configure b/libphobos/configure
index 9da06f087d0..0db0acfb9c2 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -15192,14 +15192,6 @@ fi
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
- case "$target_cpu" in
- aarch64* | \
- arm* | \
- i[34567]86|x86_64 | \
- powerpc)
- druntime_fiber_asm_external=yes
- ;;
- esac
if test "$druntime_fiber_asm_external" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5
$as_echo_n "checking for library containing swapcontext... " >&6; }
diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4
index 45a56f6f76a..fef6e890b1e 100644
--- a/libphobos/m4/druntime/libraries.m4
+++ b/libphobos/m4/druntime/libraries.m4
@@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT],
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
- case "$target_cpu" in
- aarch64* | \
- arm* | \
- i[[34567]]86|x86_64 | \
- powerpc)
- druntime_fiber_asm_external=yes
- ;;
- esac
if test "$druntime_fiber_asm_external" = no; then
AC_SEARCH_LIBS([swapcontext], [c ucontext], [],
AC_MSG_ERROR([swapcontext required but not found]))

View file

@ -1,115 +0,0 @@
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,107 @@
From 9cef407678b40c20ecc39850c7e43346ad92a60b Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Mon, 27 Jun 2022 03:31:45 +0100
Subject: [PATCH] c++: avoid <memory> poisoning on musl [PR106102]
On musl <pthread.h> uses calloc() (via <sched.h>). <memory> includes
it indirectly and exposes use of poisoned calloc() when module code
is built:
/build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc
In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/x86_64-unknown-linux-musl/bits/gthr-default.h:35,
....
from /build/build/prev-x86_64-unknown-linux-musl/libstdc++-v3/include/memory:77,
from ../../gcc-13-20220626/gcc/../libcody/cody.hh:24,
from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.h:25,
from ../../gcc-13-20220626/gcc/cp/../../c++tools/resolver.cc:23,
from ../../gcc-13-20220626/gcc/cp/mapper-resolver.cc:32:
/<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
84 | void *calloc(size_t, size_t);
| ^
/<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
| ^
gcc/cp/
PR c++/106102
* mapper-client.cc: Include <memory> via "system.h".
* mapper-resolver.cc: Ditto.
* module.cc: Ditto.
libcc1/
PR c++/106102
* libcc1plugin.cc: Include <memory> via "system.h".
* libcp1plugin.cc: Ditto.
(cherry picked from commit 3b21c21f3f5726823e19728fdd1571a14aae0fb3)
---
gcc/cp/mapper-client.cc | 1 +
gcc/cp/mapper-resolver.cc | 1 +
gcc/cp/module.cc | 1 +
libcc1/libcc1plugin.cc | 1 +
libcc1/libcp1plugin.cc | 1 +
5 files changed, 5 insertions(+)
diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
index 8603a886a09..fe9544b5ba4 100644
--- a/gcc/cp/mapper-client.cc
+++ b/gcc/cp/mapper-client.cc
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_STRING
#define INCLUDE_VECTOR
#define INCLUDE_MAP
+#define INCLUDE_MEMORY
#include "system.h"
#include "line-map.h"
diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc
index e3d29fb5ada..e70d1b4ae2c 100644
--- a/gcc/cp/mapper-resolver.cc
+++ b/gcc/cp/mapper-resolver.cc
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_VECTOR
#define INCLUDE_ALGORITHM
#define INCLUDE_MAP
+#define INCLUDE_MEMORY
#include "system.h"
// We don't want or need to be aware of networking
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index cebf9c35c1d..5c5d02bb523 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -202,6 +202,7 @@ Classes used:
#define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#define INCLUDE_VECTOR
#include "system.h"
diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 12ab5a57c8d..bdd0bdabe77 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -31,6 +31,7 @@
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
+#define INCLUDE_MEMORY
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 83dab7f58b1..e2d5039a0a1 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -32,6 +32,7 @@
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
+#define INCLUDE_MEMORY
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"

View file

@ -0,0 +1,117 @@
From f982c816d8f52a65231544b838160484b5ed4c71 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <siarheit@google.com>
Date: Mon, 27 Jun 2022 14:44:48 +0100
Subject: [PATCH] jit: avoid calloc() poisoning on musl [PR106102]
On musl <pthread.h> uses calloc() (via <sched.h>). jit/ includes
it directly and exposes use of poisoned calloc():
/build/build/./prev-gcc/xg++ ... ../../gcc-13-20220626/gcc/jit/jit-playback.cc
make[3]: *** [Makefile:1143: jit/libgccjit.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /<<NIX>>/musl-1.2.3-dev/include/pthread.h:30,
from ../../gcc-13-20220626/gcc/jit/jit-playback.cc:44:
/<<NIX>>/musl-1.2.3-dev/include/sched.h:84:7: error: attempt to use poisoned "calloc"
84 | void *calloc(size_t, size_t);
| ^
/<<NIX>>/musl-1.2.3-dev/include/sched.h:124:36: error: attempt to use poisoned "calloc"
124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
| ^
The change moves <pthread.h> inclusion to "system.h" under new
INCLUDE_PTHREAD_H guard and uses this mechanism in libgccjit.
gcc/
PR c++/106102
* system.h: Introduce INCLUDE_PTHREAD_H macros to include <pthread.h>.
gcc/jit/
PR c++/106102
* jit-playback.cc: Include <pthread.h> via "system.h" to avoid calloc()
poisoning.
* jit-recording.cc: Ditto.
* libgccjit.cc: Ditto.
(cherry picked from commit 49d508065bdd36fb1a9b6aad9666b1edb5e06474)
---
gcc/jit/jit-playback.cc | 3 +--
gcc/jit/jit-recording.cc | 2 +-
gcc/jit/libgccjit.cc | 2 +-
gcc/system.h | 4 ++++
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
index 6be6bdf8dea..79714132b91 100644
--- a/gcc/jit/jit-playback.cc
+++ b/gcc/jit/jit-playback.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_PTHREAD_H
#include "system.h"
#include "coretypes.h"
#include "target.h"
@@ -41,8 +42,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "stmt.h"
-#include <pthread.h>
-
#include "jit-playback.h"
#include "jit-result.h"
#include "jit-builtins.h"
diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
index a31720f043e..5556b9c4905 100644
--- a/gcc/jit/jit-recording.cc
+++ b/gcc/jit/jit-recording.cc
@@ -19,13 +19,13 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_PTHREAD_H
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "pretty-print.h"
#include "toplev.h"
-#include <pthread.h>
#include "jit-builtins.h"
#include "jit-recording.h"
diff --git a/gcc/jit/libgccjit.cc b/gcc/jit/libgccjit.cc
index cc6486c9cad..4c991e5436b 100644
--- a/gcc/jit/libgccjit.cc
+++ b/gcc/jit/libgccjit.cc
@@ -19,12 +19,12 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_PTHREAD_H
#include "system.h"
#include "coretypes.h"
#include "timevar.h"
#include "typed-splay-tree.h"
#include "cppbuiltin.h"
-#include <pthread.h>
#include "libgccjit.h"
#include "jit-recording.h"
diff --git a/gcc/system.h b/gcc/system.h
index c5562cc49a3..e10c34f70ec 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -750,6 +750,10 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
#endif
#endif
+#ifdef INCLUDE_PTHREAD_H
+#include <pthread.h>
+#endif
+
#ifdef INCLUDE_ISL
#ifdef HAVE_isl
#include <isl/options.h>

View file

@ -1,94 +0,0 @@
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

@ -0,0 +1,28 @@
From d54419ddcc14f52517017147201560da5353c436 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 17 Jul 2022 02:52:13 +0200
Subject: [PATCH] libgo: adjust name of union in sigevent struct
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The union in struct sigevent is named __sev_fields on musl but
_sigev_un on glibc. Not sure what this code actually does and
how this works if the union layout is different…
---
libgo/go/runtime/os_linux.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgo/go/runtime/os_linux.go b/libgo/go/runtime/os_linux.go
index 96fb178870e..a75a2dd703f 100644
--- a/libgo/go/runtime/os_linux.go
+++ b/libgo/go/runtime/os_linux.go
@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
var sevp _sigevent
sevp.sigev_notify = _SIGEV_THREAD_ID
sevp.sigev_signo = _SIGPROF
- *((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
+ *((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
if ret != 0 {
// If we cannot create a timer for this M, leave profileTimerValid false

View file

@ -1,298 +0,0 @@
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 01be086df55016ad676685c6b0dca6aa11330bfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 17 Jul 2022 13:38:39 +0200
Subject: [PATCH] libphobos: don't define __mode_t twice on musl targets
For musl targets, __mode_t is already aliased to uint, thus if it
aliased in an architecture-specific if-case then it is defined twice
which causes a build error.
To-Do: Report this upstream or revise this patch in a way that is also
works with glibc and submit that upstream.
---
libphobos/libdruntime/core/sys/posix/sys/stat.d | 7 -------
1 file changed, 7 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
index 1fb4e44cbbf..ca31bbb7ccf 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
@@ -167,7 +167,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = size_t;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -483,7 +482,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -565,7 +563,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = size_t;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -660,7 +657,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -746,7 +742,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -838,7 +833,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = uint;
alias __uid_t = uint;
alias __gid_t = uint;
@@ -914,7 +908,6 @@ version (linux)
alias __dev_t = ulong;
alias __ino_t = c_ulong;
alias __ino64_t = ulong;
- alias __mode_t = uint;
alias __nlink_t = ulong;
alias __uid_t = uint;
alias __gid_t = uint;

View file

@ -1,75 +0,0 @@
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,36 @@
From 3825632cf4007ac93d8e44705a6da042c496318b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 18 Jul 2022 20:34:39 +0200
Subject: [PATCH] libgo: Explicitly define SYS_timer_settime for 32-bit musl
arches
On 32-bit systems musl only defines SYS_timer_settime32 not
SYS_timer_settime. This causes the following compilation error:
os_linux.go:251:30: error: reference to undefined name '_SYS_timer_settime'
251 | return int32(syscall(_SYS_timer_settime, uintptr(timerid), uintptr(flags), uintptr(unsafe.Pointer(new)), uintptr(unsafe.Pointer(old)), 0, 0))
| ^
This commit fixes this error by defining SYS_timer_settime to
SYS_timer_settime32 if the latter is defined.
---
libgo/sysinfo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index b85add15a7b..ff04706a993 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -343,6 +343,12 @@ enum {
#endif
};
+// musl libc does not have SYS_timer_settime on 32-bit platforms
+// but defines SYS_timer_settime32 instead, alias accordingly.
+#ifdef SYS_timer_settime32
+#define SYS_timer_settime SYS_timer_settime32
+#endif
+
// musl libc has both off64_t and loff_t. However, both of these types
// are defined as CPP macros, not as C typedefs. Unfortunately, the GCC
// -fdump-go-spec option, which is responsible for generating type

View file

@ -0,0 +1,22 @@
From 4b28b8356c7ecf9375a2c07ac6be226a5693f8d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Tue, 19 Jul 2022 01:05:11 +0200
Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc
---
gcc/ada/libgnat/s-parame.ads | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads
index 4b8111402ba..b670e78c53b 100644
--- a/gcc/ada/libgnat/s-parame.ads
+++ b/gcc/ada/libgnat/s-parame.ads
@@ -102,7 +102,7 @@ package System.Parameters is
-- Characteristics of time_t type --
------------------------------------
- time_t_bits : constant := Long_Integer'Size;
+ time_t_bits : constant := Long_Long_Integer'Size;
-- Number of bits in type time_t
----------------------------------------------

View file

@ -0,0 +1,28 @@
From 75a430f66760802bf1ac5afcd716613e3cf8c77d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Tue, 19 Jul 2022 07:15:25 +0200
Subject: [PATCH] libgo: make match.sh POSIX-shell compatible
The `(( expression ))` syntax is a Bash extension. However, the
arithmetic expressions used by the gobuild() function can also
be expressed using Arithmetic POSIX Expansion with `$(( expression ))`.
Contrary to the Bash expression, the Arithmetic Expansion doesn't set
the return value if the expression is non-zero but instead just prints
the expression result. Hence, the expression also needs to be negated.
---
libgo/match.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgo/match.sh b/libgo/match.sh
index 7ed587ff794..b355d47429a 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -111,7 +111,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((! ( line )))
}
matched=

View file

@ -24,14 +24,14 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-aarch64
_pkgbase=11.2.1
pkgver=11.2.1_git20220219
_pkgbase=12.1.1
pkgver=12.1.1_git20220630
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64
pkgrel=5
pkgrel=1
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
@ -117,11 +117,15 @@ else
_builddir="$srcdir/build"
fi
case "$CARCH" in
# GDC hasn't been ported to PowerPC
# See libphobos/configure.tgt in GCC sources for supported targets
# riscv fails with: error: static assert "unimplemented"
case "$CARCH" in
ppc64le|riscv64) LANG_D=false ;;
# GDC does currently not work on 32-bit musl architectures.
# This is a known upstream issue.
# See: https://github.com/dlang/druntime/pull/3383
armhf|armv7|x86) LANG_D=false ;;
esac
# libitm has TEXTRELs in ARM build, so disable for now
@ -167,7 +171,7 @@ fi
if $LANG_D; then
subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc"
_languages="$_languages,d"
makedepends_build="$makedepends_build libucontext-dev"
makedepends_build="$makedepends_build libucontext-dev gcc-gdc-bootstrap"
fi
if $LANG_OBJC; then
subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc"
@ -220,44 +224,43 @@ source="https://dev.alpinelinux.org/~nenolod/gcc-${pkgver}.tar.xz
0012-libitm-disable-FORTIFY.patch
0013-libgcc_s.patch
0014-nopie.patch
0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
0016-dlang-update-zlib-binding.patch
0017-dlang-use-libucontext-on-mips64.patch
0018-dlang-libdruntime-define-fcntl.h-constants-for-mips6.patch
0019-ada-fix-shared-linking.patch
0020-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0021-add-fortify-headers-paths.patch
0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0024-mips64-disable-multilib-support.patch
0025-aarch64-disable-multilib-support.patch
0026-s390x-disable-multilib-support.patch
0027-ppc64-le-disable-multilib-support.patch
0028-x86_64-disable-multilib-support.patch
0029-riscv-disable-multilib-support.patch
0030-always-build-libgcc_eh.a.patch
0031-ada-libgnarl-compatibility-for-musl.patch
0032-ada-musl-support-fixes.patch
0033-gcc-go-Fix-handling-of-signal-34-on-musl.patch
0034-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
0035-gcc-go-signal-34-is-special-on-musl-libc.patch
0036-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
0037-gcc-go-link-to-libucontext.patch
0038-Use-generic-errstr.go-implementation-on-musl.patch
0039-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0040-configure-fix-detection-of-atomic-builtins-in-libato.patch
0041-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
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-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
libgo-musl-1.2.3.patch
0015-dlang-use-libucontext-on-mips64.patch
0016-ada-fix-shared-linking.patch
0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0018-add-fortify-headers-paths.patch
0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0021-mips64-disable-multilib-support.patch
0022-aarch64-disable-multilib-support.patch
0023-s390x-disable-multilib-support.patch
0024-ppc64-le-disable-multilib-support.patch
0025-x86_64-disable-multilib-support.patch
0026-riscv-disable-multilib-support.patch
0027-always-build-libgcc_eh.a.patch
0028-ada-libgnarl-compatibility-for-musl.patch
0029-ada-musl-support-fixes.patch
0030-gcc-go-Fix-handling-of-signal-34-on-musl.patch
0031-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
0032-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
0033-gcc-go-link-to-libucontext.patch
0034-Use-generic-errstr.go-implementation-on-musl.patch
0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
0040-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
0045-druntime-link-against-libucontext-on-all-platforms.patch
0046-c-avoid-memory-poisoning-on-musl-PR106102.patch
0047-jit-avoid-calloc-poisoning-on-musl-PR106102.patch
0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch
"
# we build out-of-tree
@ -360,6 +363,8 @@ build() {
echo ""
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2"
export CPPFLAGS="$CPPFLAGS -O2"
mkdir -p "$_builddir"
cd "$_builddir"
@ -724,57 +729,56 @@ gnat() {
}
sha512sums="
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
fa59b0fb081d97f8f63506b8793699588a95c602b5d468140eb1e80456597e52e1cc45dc0b234ac8e60e2b0cd606d94d111c8b0ae64c0a2be1bc1b8a184ceb93 libgo-musl-1.2.3.patch
43de66dfed7b5351bb543f7f2e8253e63d1e544e5bd293829e8ec7bffe60925cabcf8f6972fe8825100b1f1d7839e41d9314ec650c1320150c09317e2be24aa9 gcc-12.1.1_git20220630.tar.xz
41cbb4d69218006cf9e0cdb6c86212ef451f8decd52a50a7dbb4d34726009da7a4e0261c852b46cb584db253a4bae2f31dc485c506cb545e64a7d26e0ba6c2b6 0001-posix_memalign.patch
531155055cda7f119bcac6479bcae73af9201cd596af9cf1616850bbcf4393b91c5de9f2fbbc1cde6e158fb4df7237b033146f662dff5fa0ea12151cc514adb8 0002-gcc-poison-system-directories.patch
c1275d77b5269386a2ec683933570810f5a2ba1208c161ed887797eb9aee3cb82ef08a8964635902614e6a6e83f3065ba0801c9355d85dd8d60cb1fa20bdf687 0003-specs-turn-on-Wl-z-now-by-default.patch
a54e45bff4484a35d3826435a414d909281453f5605f4081cf3be1f15336cceed93a1d8a54e92e2fa97188623e3030ca1323d7749141e228a7db73795230d86a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
ad132ddbd0c33a3983e3de4f74d8fdb8cb1ddf53ef54de0a5c12efb49e42014ed117165d43f396bcf3455ecfe2c8620e0326e73b4160a370a4cc92d213329c34 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
0b9ce0f130a7b797770f3d58a5200575f20e5663c86c0c5710718b7bffd3416cc2f05861613d9c258428e9541c6e0b9837d01f0c99d383e2c3de0503a988e861 0006-Enable-Wformat-and-Wformat-security-by-default.patch
e7813acc7ead61373c212cefbe53eb020b4c5bd8f0f35ee972e0524060713f911624f5a1a871feada642e1f3f5e48c8508125ca2da09de351d544bedf1d44ada 0007-Enable-Wtrampolines-by-default.patch
d0d0566a11e4828bdd6f53346a9a6b9841f3066d3f4a05ee2b6fe97aeb4552654170e7662318ea18fc777c3e75c88a067097478fc4e880a3f9c134b8a3af2277 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
f75e63d9d933874f18fb7f55b135c60dfa0377abafa8e0edb91b85d5f00f4f072d0a338ba5d9baec18494211dbbda8068782830dbafbb37068936f76aede270f 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
afa4daba222a19569588736a8276dc7c12223a7c222f3dd3795dc3f1cd90f40b90518971ae27b358020354f89562c9680ec8b8e24e85e6d4f8e54e79d185359b 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
79dac82249fb573ec477e1451a33883302eb63a5110853faed117f5021221f2153e2ec845dd5a0043b1bf9f0e5736ef0c89743ff2d771774a281c8b24542803a 0011-libiberty-copy-PIC-objects-during-build-process.patch
b035f85c1703b45d15c1d1ffe7d23400e01625e5d403504911cc92f740b02586447de2a9d66a9f80f12b9c227bc193e2a43942c8af2bdb42cdeff8272bbe6068 0012-libitm-disable-FORTIFY.patch
9fb4d396a9493d2d68fe829ce075ba4c5df148b1d6aaab315a6f8ccbdd70d0e052a5dc50369adc2dab005b4a3becd1504b182faed6e82c86accb95f5bc2b9f50 0013-libgcc_s.patch
f82ac22961d842c9f8e731a601bb255918cc160969888363ad2d83e2ccf08b19114a200d46bcf99d097bf530f470c2b1e71e46828bc1b9fff5469ff945f541d8 0014-nopie.patch
6527dc9d250db48d56cf01e9299461bf22a838ffda96c40d448e18f457b206cec2322275d2d5abbbaf3c6573c5e7eba12724c9691b601f118ff7520e19726373 0015-dlang-use-libucontext-on-mips64.patch
6c3ce0ccd68b19e2c76172d8f24b0747ee0af2b8de7af692f2f699848267d7fc42fec8e5c303102fe05be7e934b56f21eea17ce47c8aca20570590830d88e9b0 0016-ada-fix-shared-linking.patch
7089a96aaec8e0b222cb3fa7301d71bb2e328a24dec33e15ea9e3e7695bcae919308249b9a3be5ea2f3b1f069f9fd1739066f31d12317fcdab0596dba9ca54a4 0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
b7ebdeee0b143052fdd6e3efa070ea8621d4fb729312cbc787d618e666b593990a20cd9044a786265970d8e09ec13da03b797009543d0b657b0fe924f2dcaa68 0018-add-fortify-headers-paths.patch
8e682893d6367732ab8c490b915112a68d98855deec3bd8db91dc0d9bf486b8c044b13ee2b95c4806da7ac17c41034e081b7a66861018274cb33fdb2fd6df04a 0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
a14c5f98ade5af8cd6e3a0244752674d9c4f6dadb4260f98f1949bff51ac1211a3f8319e0f933f776e98998d2c7221004f92413f97ccc2e966f8462ed6d33597 0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
28c1d477da79aa212ac79e4b02cf865d8b9c31cec6c42f41b4268e3f3c49bf67fb51e54180abe543a54e550788bb472bfcf1b4bc38d072a792d7403dbbee178a 0021-mips64-disable-multilib-support.patch
0920e31c46bf937b47a0602766f042d45adb71abf332ee84399c665c12298ef115cff945fe26d646b0276bfdfdd04913970e6f1f8784a11c26e15111c854643d 0022-aarch64-disable-multilib-support.patch
e4c6bf7ec40f2798c8e5b40a543aecffd5591a2805546b3b97aaa4fbe4df6ce4330a60973a9ddfbca9890590606d5204e7f653ab2b6e4b2c13feeb595b68e63a 0023-s390x-disable-multilib-support.patch
0e956d793c94283ce5af7fe84bfcbb655585a9573608e9bf497fa7b726e12daa391e44977d0a8c97fb460aba89b1773b91e036b0ee1ef4d6263a3943cb63d9cd 0024-ppc64-le-disable-multilib-support.patch
95917fcb60dbc0a8134db9beb583f3c9ea61128499c214f594c434ec8246641ec41e245ce2d1d9b85ffd40ea0e5764f7a33c5522b2547145814245ac0fa25025 0025-x86_64-disable-multilib-support.patch
b40d7e4712c035674c993bbb55475290ec14523b3f0fd05493514bac4e9adaa6641faf815fc40ffc00119d9fd64be28218ee874c289ec7430eeef05ab2fcae5e 0026-riscv-disable-multilib-support.patch
674360ce2ee9f704d0632cc98756f9fe8dd8ca30064fb9d3423b437f7e679c1c51e765b15e535dcb278cd2769583690acb3395b91e4fd5f6f4e3b97879fcc313 0027-always-build-libgcc_eh.a.patch
f060687adcd5297124e4000f1ba1e3fd5d7d124da04d948cbd0d4a6c69a90a2b29a4a0dbbe13a83ab6950724f434de012b681bdbcdf53c0100b40fe3d00f2f2f 0028-ada-libgnarl-compatibility-for-musl.patch
5160bae68e20a1966c1f6d655ee98af759e9b9ee842718ae6007d467b418e1cf3b307528a0841477b5259671ce868521b06c0f2e947b7b8f3a398c53dd978252 0029-ada-musl-support-fixes.patch
74c70a752ff24f231b45c69ca1d86ebf261bca643334cb6ba518ac204986ccd7fa84f4df4fdb38bbc0bb61832514b0100b2d2ba069fb1842929369d073220f24 0030-gcc-go-Fix-handling-of-signal-34-on-musl.patch
9786711f308d5f93f2f5a45862f340d4741e1d8aef116d696b85a6debb6149d3772b0cfab4d9ef8782172b102664d9acdd27021af433b504c5918f379b1dd978 0031-There-are-more-than-one-st_-a-m-c-tim-fields-in-stru.patch
4ffd2f279fbcf5abb1ac8cc6435204e48a776e7ef3742f2120eef1a1bdca2d0a01d30c481fd1495926c9166daaf127f9013fda0efefe3ed7bf6e660915cc1b49 0032-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch
0ad15e78806031cef68da6577f7ce9be178533b3768ca42fff7f12816d61fa745acc77be2e047ac1c5bfdbc04e999202e5cefd04042bca798177197236b79954 0033-gcc-go-link-to-libucontext.patch
699dc3641099da6136dd3689f06c6553c03b3a85acf83a3fce1beb5425065b3e378535ca9e9100a120fdbafc34871d61c063fd5328a49cd87a15a989ed51706d 0034-Use-generic-errstr.go-implementation-on-musl.patch
d9ba710f770e053c8f212e821817c188091a829658050b9ab5906388553ec60fec37943ea43c270e92a9014902949f3c98fc4639032d92b8145b375bb29e193e 0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
ab90d8fdd977d6cd3da096a1c76d77be3e89a020b2127247771711a32eb608cceed21834ef488ab4b69bb0f408b098fdfb61630819e3d1a1e57d5af67800ee74 0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
7b356e11f66877bee864e2b1f81ae4be6c6c586040afb3ac220ff902f694efd60dcb4647cc7a37890c91dd539535b9992d463b785d3158205dbf9369b17c8ab7 0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
5905e4309670cfa4a5883aa21f744391ee2107731795817e0ffcccfaa22b0c21df883038c86362b091e7b35730aa4de6dce827c908ea398a161add851df5c31e 0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
570e084d223671fa29cb460b1b536a216920a7bcdfcdad21fe8cd7610e13f6942c1b1dd34ec861e9e3d830b9fe1f0e02e305c50c54d83aaf20526be09ca2256c 0040-libgo-include-asm-ptrace.h-for-pt_regs-definition-on.patch
a8b53c7d6e0d6d19c655844cab074f49b8f14c54a7af920b5792303f73713fdc69b723a0a6041548d227dfaa98ef63641460ea355487619eb29f9fec4a1e301b 0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
15c93c9f2d68b19d00c6e82748e5f14470a120a3996f64d1ce91f17a65a5334cca478b4a6eba7d2d0a1d6d22206407ac3b1b5255987cc1144f5177bbb68153c8 0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
25014dfa99d96ee70ce0ad22e9f7974f0a51cc50b3b9c2db49df50774c8cd29e497ceed120486bee50be83bfb07f2009ed310eb9b0543f2795bd7359b87eadd2 0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
75fd83ac05ab0a08d5f48547b08810f9934209bc78b5db59d65f33887b382af7ec24d8a29d40f86325c05af40c1ae1ec6466c839f646af90afc895a13073d07b 0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
13e047153076d6e1fc40c9f5b6bfe5699c0e5460248f3d2b35ae36677cb960525af7b0b025997e5000a8492cec5e77a86828d66b4058c0d7f89fde0ab3890142 0045-druntime-link-against-libucontext-on-all-platforms.patch
ba87d4b4433e5f018071ce933ae523c62334574be2e46881a8945c9dc7ecc0fadfed3aaf837f13f93fd4c0d6d33feb24cb67c77d9c0adb40b62637991fed4374 0046-c-avoid-memory-poisoning-on-musl-PR106102.patch
03e7c0caf59ee7c7d13a840178befb378b734f18a5c36ec4bbfad3f78253f0afab80864ea0905b58454178c8c31b2441622dd38668dd54e6550e30e6249e882b 0047-jit-avoid-calloc-poisoning-on-musl-PR106102.patch
be7688a44707991c31337bff24245394aa385e7b4ba151f18e21e734a4bbb151348458f413965e5cba50185ab8e0aba8b793eba04c0802dc563b148ed490f26d 0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
179cd15d629884a66e954fd76066675efa594686b970facbb12ad50769e5d70b5530d7f61e77120e26d1c3dfc701cfc5295f341f635db998df73c41bc8e62172 0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
d7592589cbf982f4518cb07572f96131278c7d2fd8fbbcd7fcb47f6628529ae9a5fc22b2dfe929be06845d137e1c5d2efeb6f63b1c2fb9c36cd6bdb97d41c65f 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
29c4fe28e5bf232e01b44106b2f8a3e50b5e00fc4302a69d3f5f90695e43ef07721a917b51d49dc40ae0543d8d97d432cb475834059c92176b73d326af9496e3 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
"

View file

@ -1,13 +0,0 @@
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 6fef104..06289a4 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -126,7 +126,7 @@ if ! grep '^const SIGCLD ' ${OUT} >/dev/null 2>&1; then
fi
# The syscall numbers. We force the names to upper case.
-grep '^const _SYS_' gen-sysinfo.go | \
+grep '^const _SYS_[a-z]' gen-sysinfo.go | \
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
while read sys; do
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`

View file

@ -1,4 +1,4 @@
From feb04e50d907683385cc4dc0163cf1d82258073a Mon Sep 17 00:00:00 2001
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 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
@ -8,7 +8,7 @@ Subject: [PATCH] posix_memalign
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index 1b0bfe37852..d7b2b19bb3c 100644
index 3b2e4f47915..20f790904a2 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@ -37,6 +37,3 @@ index 1b0bfe37852..d7b2b19bb3c 100644
return __ptr;
else
return NULL;
--
2.35.1

View file

@ -1,4 +1,4 @@
From d64825212f807435a4b2f8e068c0f65195c8e2e6 Mon Sep 17 00:00:00 2001
From dd1e75ff4ecda96957465b34681f245e818928bd 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
@ -21,15 +21,15 @@ Upstream-Status: Pending
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 21 +++++++++++++++++++++
gcc/gcc.cc | 2 ++
gcc/incpath.cc | 21 +++++++++++++++++++++
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index a75b44ee47e..d15105a73f3 100644
index 8a0dafc522d..0357868e22c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -683,6 +683,10 @@ Wreturn-local-addr
@@ -710,6 +710,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
@ -41,10 +41,10 @@ index a75b44ee47e..d15105a73f3 100644
Common Var(warn_shadow) Warning
Warn when one variable shadows another. Same as -Wshadow=global.
diff --git a/gcc/config.in b/gcc/config.in
index 2de5a463315..059c818c895 100644
index 64c27c9cfac..f0fbf123aa8 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -218,6 +218,12 @@
@@ -230,6 +230,12 @@
#endif
@ -58,10 +58,10 @@ index 2de5a463315..059c818c895 100644
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
diff --git a/gcc/configure b/gcc/configure
index 708328e1670..4b977e313b5 100755
index 5ce0557719a..e9060112384 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1020,6 +1020,7 @@ enable_maintainer_mode
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@ -69,7 +69,7 @@ index 708328e1670..4b977e313b5 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1782,6 +1783,8 @@ Optional Features:
@@ -1785,6 +1786,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@ -78,7 +78,7 @@ index 708328e1670..4b977e313b5 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31790,6 +31793,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@ -99,10 +99,10 @@ index 708328e1670..4b977e313b5 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index df1c9cc3200..5461bab88a9 100644
index 23bee7010a3..75a7048045c 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7311,6 +7311,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@ -120,10 +120,10 @@ index df1c9cc3200..5461bab88a9 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index cf536a15116..7d3f1ccddf3 100644
index 07b440190c3..b2de464798a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
@ -131,7 +131,7 @@ index cf536a15116..7d3f1ccddf3 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
@@ -7728,6 +7729,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -8029,6 +8030,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.
@ -146,11 +146,11 @@ index cf536a15116..7d3f1ccddf3 100644
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 8ba410c9e17..a83ba34ac4b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1152,6 +1152,8 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..47fb5802194 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
@ -159,10 +159,10 @@ index 8ba410c9e17..a83ba34ac4b 100644
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 446d280321d..fbfc0ce03b8 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
@ -171,7 +171,7 @@ index 446d280321d..fbfc0ce03b8 100644
/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -395,6 +396,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
@ -198,6 +198,3 @@ index 446d280321d..fbfc0ce03b8 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.35.1

View file

@ -1,4 +1,4 @@
From 9675297b3a46b65a54e9df97f26ea445d53c67c6 Mon Sep 17 00:00:00 2001
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 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
@ -10,14 +10,14 @@ Binutils does not appear to have a similar option for enabling -z
now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.c | 1 +
gcc/gcc.cc | 1 +
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 7d3f1ccddf3..485d2d6b742 100644
index b2de464798a..83bd1bde433 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15921,6 +15921,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -16872,6 +16872,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}.
@ -27,11 +27,11 @@ index 7d3f1ccddf3..485d2d6b742 100644
@item -u @var{symbol}
@opindex u
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a83ba34ac4b..faf9ce76b3d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1150,6 +1150,7 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 47fb5802194..d18b5d7b59a 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
@ -39,6 +39,3 @@ index a83ba34ac4b..faf9ce76b3d 100644
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.35.1

View file

@ -1,19 +1,19 @@
From 4eb1b3849325b77c4cb66b675119299de35125bb Mon Sep 17 00:00:00 2001
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 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,
ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.c | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.cc | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 11e015bdb87..de8b7bf246f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1427,6 +1427,10 @@ c_cpp_builtins (cpp_reader *pfile)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,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 11e015bdb87..de8b7bf246f 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 485d2d6b742..164929f7583 100644
index 83bd1bde433..dda299a9987 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10225,6 +10225,12 @@ also turns on the following optimization flags:
@@ -10896,6 +10896,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.
@ -41,6 +41,3 @@ index 485d2d6b742..164929f7583 100644
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.35.1

View file

@ -1,4 +1,4 @@
From 8de5d46c530ceca9f4add46d5cae3cd52c38eba3 Mon Sep 17 00:00:00 2001
From 75d1a35180cf0967f062765314bf091a64032062 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,
@ -18,11 +18,11 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
gcc/config/rs6000/sysv4.h | 2 +-
gcc/config/s390/linux.h | 2 +-
gcc/config/sparc/linux.h | 2 +-
gcc/gcc.c | 28 ++++++++++++++++++++--------
gcc/gcc.cc | 28 ++++++++++++++++++++--------
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 7f2529a2a1d..b097e1688aa 100644
index 5e4553d79f5..b516f3ef97f 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@ -34,7 +34,7 @@ index 7f2529a2a1d..b097e1688aa 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index c1dae8ca2cf..a87dc740171 100644
index 17f16a55910..9ec667e9a5e 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
@ -47,7 +47,7 @@ index c1dae8ca2cf..a87dc740171 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 0c1c4e70b6b..8b581afacdd 100644
index df3da67c4f0..7532bc29f9b 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@ -59,7 +59,7 @@ index 0c1c4e70b6b..8b581afacdd 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 5ebbf42a13d..902378e1bad 100644
index 857c0e077bf..8433e56c3e1 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -87,7 +87,7 @@ index 5ebbf42a13d..902378e1bad 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index a23e7ab3eb7..12ac8cb93a9 100644
index 0102b2a6f3b..994414c1845 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
@ -100,7 +100,7 @@ index a23e7ab3eb7..12ac8cb93a9 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index f3e25b1412a..712b0f1c30e 100644
index abc8cf624ca..fe656aeae27 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -112,7 +112,7 @@ index f3e25b1412a..712b0f1c30e 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index ac40c3dfd3f..6e19e25c35a 100644
index 93510098ccc..3813e536423 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@ -125,7 +125,7 @@ index ac40c3dfd3f..6e19e25c35a 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index a390bcece83..be0ee289367 100644
index 6aad7192e69..e1256a55add 100644
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
@ -137,7 +137,7 @@ index a390bcece83..be0ee289367 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index fce5b896e6e..ee29979dd34 100644
index 38803723ba9..3067ed6eac8 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
@ -149,10 +149,10 @@ index fce5b896e6e..ee29979dd34 100644
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index e3f2cd254f6..43499ed29cf 100644
index b2a7afabc73..34ceb4e4fce 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -374,13 +374,13 @@ extern int dot_symbols;
@@ -377,13 +377,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
@ -169,10 +169,10 @@ index e3f2cd254f6..43499ed29cf 100644
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 510abe169c5..3c1f3a8ec5d 100644
index 7e2519de5d4..61215a7a1b3 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@ -182,7 +182,7 @@ index 510abe169c5..3c1f3a8ec5d 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index daa48fdfc2b..2fcfc5d770f 100644
index d7b7e7a7b02..d2287f14f2e 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
@ -195,7 +195,7 @@ index daa48fdfc2b..2fcfc5d770f 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 2550d7ee8f0..7596d0b2757 100644
index 6a809e9092d..93bfb92d3ff 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@ -207,11 +207,11 @@ index 2550d7ee8f0..7596d0b2757 100644
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.c b/gcc/gcc.c
index faf9ce76b3d..1ad5da6d769 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -737,8 +737,11 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d18b5d7b59a..3b76311b544 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -744,8 +744,11 @@ proper position among the other output files. */
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -225,7 +225,7 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -773,8 +776,11 @@ proper position among the other output files. */
@@ -780,8 +783,11 @@ proper position among the other output files. */
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -239,7 +239,7 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -791,8 +797,11 @@ proper position among the other output files. */
@@ -798,8 +804,11 @@ proper position among the other output files. */
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -253,7 +253,7 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -807,8 +816,11 @@ proper position among the other output files. */
@@ -814,8 +823,11 @@ proper position among the other output files. */
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
@ -267,6 +267,3 @@ index faf9ce76b3d..1ad5da6d769 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.35.1

View file

@ -1,4 +1,4 @@
From 85e12e3d32a44c3fd10b5327edd542972a179eec Mon Sep 17 00:00:00 2001
From c664283dd30949c5299d1c45bd5740bcfe993d22 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.
@ -8,10 +8,10 @@ Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 2005b783c68..c5c6af427cc 100644
index 07da40ef43b..8683f706426 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -637,7 +637,7 @@ Warn about function calls with format strings that write past the end
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
of the destination region. Same as -Wformat-overflow=1.
Wformat-security
@ -20,7 +20,7 @@ index 2005b783c68..c5c6af427cc 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -658,7 +658,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@ -29,6 +29,3 @@ index 2005b783c68..c5c6af427cc 100644
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.35.1

View file

@ -1,4 +1,4 @@
From f1e92f5f3576779776c9f3d6aeef76e1569e719a Mon Sep 17 00:00:00 2001
From e4d0ec43e772b6dc7c3708aed5309897df26a125 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.
@ -8,10 +8,10 @@ Subject: [PATCH] Enable -Wtrampolines by default.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index d15105a73f3..29f9504cb68 100644
index 0357868e22c..6d5e5eebe60 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -775,7 +775,7 @@ Common Var(warn_system_headers) Warning
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@ -19,7 +19,4 @@ index d15105a73f3..29f9504cb68 100644
+Common Var(warn_trampolines) Init(1) Warning
Warn whenever a trampoline is generated.
Wtype-limits
--
2.35.1
Wtrivial-auto-var-init

View file

@ -1,19 +1,19 @@
From 3503fd734a33b67ec6a9fdc2c52bb8310864b119 Mon Sep 17 00:00:00 2001
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b 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
Change the buffer size.
---
gcc/gcc.c | 8 +++++++-
gcc/gcc.cc | 8 +++++++-
gcc/params.opt | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1ad5da6d769..99314032ec2 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -989,6 +989,12 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 3b76311b544..cc99d0b7aa1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -996,6 +996,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@ -26,7 +26,7 @@ index 1ad5da6d769..99314032ec2 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1288,7 +1294,7 @@ static const char *cc1_options =
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
@ -36,10 +36,10 @@ index 1ad5da6d769..99314032ec2 100644
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index 8ba281b4cfa..bab39cdf8a2 100644
index b88e1372005..82a7e25dd2f 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -946,7 +946,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value.
-param=ssp-buffer-size=
@ -48,6 +48,3 @@ index 8ba281b4cfa..bab39cdf8a2 100644
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.35.1

View file

@ -1,4 +1,4 @@
From c4dd51fe15a938fdd76d781a4eede2a9205eacbc Mon Sep 17 00:00:00 2001
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 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
@ -26,7 +26,7 @@ https://bugs.gentoo.org/295480
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index ab716ff04ea..e595268d9fc 100644
index 8f51544989e..5329804d136 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@ -38,10 +38,10 @@ index ab716ff04ea..e595268d9fc 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 8edd2e05639..63f61fcf96f 100644
index 243f3db7b72..822210781fa 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -553,6 +553,7 @@ uninstall-am:
@@ -561,6 +561,7 @@ uninstall-am:
.po.mo:
@ -49,6 +49,3 @@ index 8edd2e05639..63f61fcf96f 100644
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.35.1

View file

@ -1,4 +1,4 @@
From 0a1fd78184f00fb77dac00dabe98eb025620efc2 Mon Sep 17 00:00:00 2001
From 190064993cd8ddbd48015c1fc1916e4110a97733 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.
@ -8,7 +8,7 @@ Subject: [PATCH] Don't declare asprintf if defined as a macro.
1 file changed, 3 insertions(+)
diff --git a/include/libiberty.h b/include/libiberty.h
index f4c0fe11d6f..cf4b1043e4d 100644
index a65ced9c820..eb20ab0f95f 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@ -23,6 +23,3 @@ index f4c0fe11d6f..cf4b1043e4d 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.35.1

View file

@ -1,4 +1,4 @@
From f81d67f6fe1f1066642606209c882b333d937cb7 Mon Sep 17 00:00:00 2001
From 838e1daa955d9013c462be3471497cb39641e951 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
@ -8,10 +8,10 @@ Subject: [PATCH] libiberty: copy PIC objects during build process
1 file changed, 1 insertion(+)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 4f1213b983b..d0224649d30 100644
index 1b17c2e3a47..8db1176df2e 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -264,6 +264,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
@ -19,6 +19,3 @@ index 4f1213b983b..d0224649d30 100644
cd ..; \
else true; fi
--
2.35.1

View file

@ -1,4 +1,4 @@
From 3b732288ce771348cbcc9fb633a36b7aff2b4ad4 Mon Sep 17 00:00:00 2001
From 717346fbbd6642ba6b0c3af2deb3771794346507 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
@ -8,7 +8,7 @@ Subject: [PATCH] libitm: disable FORTIFY
1 file changed, 10 insertions(+)
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index a3d84896cc5..ecb281d5919 100644
index 06e90973ef3..669e64236c3 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -47,6 +47,16 @@ if test "$gcc_cv_have_tls" = yes ; then
@ -28,6 +28,3 @@ index a3d84896cc5..ecb281d5919 100644
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
case "${target_cpu}" in
--
2.35.1

View file

@ -1,33 +1,33 @@
From a3e556187d0a8e9d39544f023960eca0f07d3e83 Mon Sep 17 00:00:00 2001
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b 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
---
gcc/config/i386/i386-expand.c | 4 ++--
libgcc/config/i386/cpuinfo.c | 6 +++---
libgcc/config/i386/t-linux | 2 +-
gcc/config/i386/i386-expand.cc | 4 ++--
libgcc/config/i386/cpuinfo.c | 6 +++---
libgcc/config/i386/t-linux | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 1772fb16c9a..77e04b0c2df 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -11066,10 +11066,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 31780b6daf7..d89898846e1 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
- /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */
- /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init in libgcc.a. */
tree call_expr, fndecl, type;
type = build_function_type_list (integer_type_node, NULL_TREE);
type = build_function_type_list (integer_type_node, NULL_TREE);
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
call_expr = build_call_expr (fndecl, 0);
call_expr = build_call_expr (fndecl, 0);
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index ef463848f9d..1a3de052c80 100644
index dab1d98060f..cf824b4114a 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
@ -52,6 +52,3 @@ index 8506a635790..564296f788e 100644
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.35.1

View file

@ -1,4 +1,4 @@
From f520e67fba621f213146271408ff3210b3527176 Mon Sep 17 00:00:00 2001
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c 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
@ -9,10 +9,10 @@ Subject: [PATCH] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index 4b977e313b5..592e81e40f6 100755
index e9060112384..2f6b3265a6c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32300,6 +32300,33 @@ fi
@@ -32497,6 +32497,33 @@ fi
$as_echo "$gcc_cv_no_pie" >&6; }
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@ -47,10 +47,10 @@ index 4b977e313b5..592e81e40f6 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 5461bab88a9..1577529ffb7 100644
index 75a7048045c..e683d3a7a5f 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7571,6 +7571,19 @@ AC_CACHE_CHECK([for -no-pie option],
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
LDFLAGS="$saved_LDFLAGS"])
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@ -70,6 +70,3 @@ index 5461bab88a9..1577529ffb7 100644
fi
AC_SUBST([NO_PIE_FLAG])
--
2.35.1

View file

@ -1,4 +1,4 @@
From 26daa73d678b87a6950df1d79d171ba40ecbce15 Mon Sep 17 00:00:00 2001
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd 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
@ -8,7 +8,7 @@ Subject: [PATCH] dlang: use libucontext on mips64
1 file changed, 1 insertion(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 0643daeb613..b74d9fb3f25 100644
index 0063dd23249..c5e782a1238 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
@ -19,6 +19,3 @@ index 0643daeb613..b74d9fb3f25 100644
;;
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
--
2.35.1

View file

@ -1,25 +0,0 @@
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
---
libffi/src/closures.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libffi/src/closures.c b/libffi/src/closures.c
index 721ff00ea43..22a699c6340 100644
--- a/libffi/src/closures.c
+++ b/libffi/src/closures.c
@@ -34,7 +34,7 @@
#include <ffi_common.h>
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
+# if __linux__ && !defined(__ANDROID__)
/* This macro indicates it may be forbidden to map anonymous memory
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
--
2.35.1

View file

@ -1,4 +1,4 @@
From 374a19de60fcd5c31321c3f4d26dcc4b631e8c3f Mon Sep 17 00:00:00 2001
From fd642f8cd61849a9dc169588be5562ceda96a889 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
@ -8,7 +8,7 @@ Subject: [PATCH] ada: fix shared linking
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
index 5cd5ef64f56..1c611a82cab 100644
index a7574efb472..0ad0d66463c 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
@ -37,6 +37,3 @@ index 5cd5ef64f56..1c611a82cab 100644
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.35.1

View file

@ -1,425 +0,0 @@
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
---
libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++-----------
1 file changed, 196 insertions(+), 70 deletions(-)
diff --git a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
index e6cce240fd5..bd2fe37ebec 100644
--- a/libphobos/src/std/zlib.d
+++ b/libphobos/src/std/zlib.d
@@ -1,7 +1,7 @@
// Written in the D programming language.
/**
- * Compress/decompress data using the $(HTTP www._zlib.net, _zlib library).
+ * Compress/decompress data using the $(HTTP www.zlib.net, zlib library).
*
* Examples:
*
@@ -43,12 +43,12 @@
* References:
* $(HTTP en.wikipedia.org/wiki/Zlib, Wikipedia)
*
- * Copyright: Copyright Digital Mars 2000 - 2011.
+ * Copyright: Copyright The D Language Foundation 2000 - 2011.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(HTTP digitalmars.com, Walter Bright)
- * Source: $(PHOBOSSRC std/_zlib.d)
+ * Source: $(PHOBOSSRC std/zlib.d)
*/
-/* Copyright Digital Mars 2000 - 2011.
+/* Copyright The D Language Foundation 2000 - 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -75,9 +75,9 @@ enum
class ZlibException : Exception
{
- this(int errnum)
- { string msg;
-
+ private static string getmsg(int errnum) nothrow @nogc pure @safe
+ {
+ string msg;
switch (errnum)
{
case Z_STREAM_END: msg = "stream end"; break;
@@ -90,7 +90,12 @@ class ZlibException : Exception
case Z_VERSION_ERROR: msg = "version error"; break;
default: msg = "unknown error"; break;
}
- super(msg);
+ return msg;
+ }
+
+ this(int errnum)
+ {
+ super(getmsg(errnum));
}
}
@@ -104,7 +109,7 @@ class ZlibException : Exception
* buf = buffer containing input data
*
* Returns:
- * A $(D uint) checksum for the provided input data and starting checksum
+ * A `uint` checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Adler-32)
@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] buf)
* buf = buffer containing input data
*
* Returns:
- * A $(D uint) checksum for the provided input data and starting checksum
+ * A `uint` checksum for the provided input data and starting checksum
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Cyclic_redundancy_check)
@@ -191,13 +196,14 @@ uint crc32(uint crc, const(void)[] buf)
ubyte[] compress(const(void)[] srcbuf, int level)
in
{
- assert(-1 <= level && level <= 9);
+ assert(-1 <= level && level <= 9, "Compression level needs to be within [-1, 9].");
}
-body
+do
{
import core.memory : GC;
+ import std.array : uninitializedArray;
auto destlen = srcbuf.length + ((srcbuf.length + 1023) / 1024) + 12;
- auto destbuf = new ubyte[destlen];
+ auto destbuf = uninitializedArray!(ubyte[])(destlen);
auto err = etc.c.zlib.compress2(destbuf.ptr, &destlen, cast(ubyte *) srcbuf.ptr, srcbuf.length, level);
if (err)
{
@@ -276,7 +282,7 @@ void[] uncompress(const(void)[] srcbuf, size_t destlen = 0u, int winbits = 15)
throw new ZlibException(err);
}
}
- assert(0);
+ assert(0, "Unreachable code");
}
@system unittest
@@ -370,9 +376,9 @@ class Compress
this(int level, HeaderFormat header = HeaderFormat.deflate)
in
{
- assert(1 <= level && level <= 9);
+ assert(1 <= level && level <= 9, "Legal compression level are in [1, 9].");
}
- body
+ do
{
this.level = level;
this.gzip = header == HeaderFormat.gzip;
@@ -406,6 +412,7 @@ class Compress
const(void)[] compress(const(void)[] buf)
{
import core.memory : GC;
+ import std.array : uninitializedArray;
int err;
ubyte[] destbuf;
@@ -420,7 +427,7 @@ class Compress
inited = 1;
}
- destbuf = new ubyte[zs.avail_in + buf.length];
+ destbuf = uninitializedArray!(ubyte[])(zs.avail_in + buf.length);
zs.next_out = destbuf.ptr;
zs.avail_out = to!uint(destbuf.length);
@@ -461,9 +468,10 @@ class Compress
void[] flush(int mode = Z_FINISH)
in
{
- assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH);
+ assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH,
+ "Mode must be either Z_FINISH, Z_SYNC_FLUSH or Z_FULL_FLUSH.");
}
- body
+ do
{
import core.memory : GC;
ubyte[] destbuf;
@@ -523,6 +531,7 @@ class UnCompress
z_stream zs;
int inited;
int done;
+ bool inputEnded;
size_t destbufsize;
HeaderFormat format;
@@ -571,16 +580,16 @@ class UnCompress
const(void)[] uncompress(const(void)[] buf)
in
{
- assert(!done);
+ assert(!done, "Buffer has been flushed.");
}
- body
+ do
{
+ if (inputEnded || !buf.length)
+ return null;
+
import core.memory : GC;
+ import std.array : uninitializedArray;
int err;
- ubyte[] destbuf;
-
- if (buf.length == 0)
- return null;
if (!inited)
{
@@ -598,26 +607,152 @@ class UnCompress
if (!destbufsize)
destbufsize = to!uint(buf.length) * 2;
- destbuf = new ubyte[zs.avail_in * 2 + destbufsize];
- zs.next_out = destbuf.ptr;
- zs.avail_out = to!uint(destbuf.length);
-
- if (zs.avail_in)
- buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf;
+ auto destbuf = uninitializedArray!(ubyte[])(destbufsize);
+ size_t destFill;
zs.next_in = cast(ubyte*) buf.ptr;
zs.avail_in = to!uint(buf.length);
- err = inflate(&zs, Z_NO_FLUSH);
- if (err != Z_STREAM_END && err != Z_OK)
+ while (true)
{
- GC.free(destbuf.ptr);
- error(err);
+ auto oldAvailIn = zs.avail_in;
+
+ zs.next_out = destbuf[destFill .. $].ptr;
+ zs.avail_out = to!uint(destbuf.length - destFill);
+
+ err = inflate(&zs, Z_NO_FLUSH);
+ if (err == Z_STREAM_END)
+ {
+ inputEnded = true;
+ break;
+ }
+ else if (err != Z_OK)
+ {
+ GC.free(destbuf.ptr);
+ error(err);
+ }
+ else if (!zs.avail_in)
+ break;
+
+ /*
+ According to the zlib manual inflate() stops when either there's
+ no more data to uncompress or the output buffer is full
+ So at this point, the output buffer is too full
+ */
+
+ destFill = destbuf.length;
+
+ if (destbuf.capacity)
+ {
+ if (destbuf.length < destbuf.capacity)
+ destbuf.length = destbuf.capacity;
+ else
+ {
+ auto newLength = GC.extend(destbuf.ptr, destbufsize, destbufsize);
+
+ if (newLength && destbuf.length < destbuf.capacity)
+ destbuf.length = destbuf.capacity;
+ else
+ destbuf.length += destbufsize;
+ }
+ }
+ else
+ destbuf.length += destbufsize;
}
+
destbuf.length = destbuf.length - zs.avail_out;
return destbuf;
}
+ // Test for issues 3191 and 9505
+ @system unittest
+ {
+ import std.algorithm.comparison;
+ import std.array;
+ import std.file;
+ import std.zlib;
+
+ // Data that can be easily compressed
+ ubyte[1024] originalData;
+
+ // This should yield a compression ratio of at least 1/2
+ auto compressedData = compress(originalData, 9);
+ assert(compressedData.length < originalData.length / 2,
+ "The compression ratio is too low to accurately test this situation");
+
+ auto chunkSize = compressedData.length / 4;
+ assert(chunkSize < compressedData.length,
+ "The length of the compressed data is too small to accurately test this situation");
+
+ auto decompressor = new UnCompress();
+ ubyte[originalData.length] uncompressedData;
+ ubyte[] reusedBuf;
+ int progress;
+
+ reusedBuf.length = chunkSize;
+
+ for (int i = 0; i < compressedData.length; i += chunkSize)
+ {
+ auto len = min(chunkSize, compressedData.length - i);
+ // simulate reading from a stream in small chunks
+ reusedBuf[0 .. len] = compressedData[i .. i + len];
+
+ // decompress using same input buffer
+ auto chunk = decompressor.uncompress(reusedBuf);
+ assert(progress + chunk.length <= originalData.length,
+ "The uncompressed result is bigger than the original data");
+
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
+ progress += chunk.length;
+ }
+
+ auto chunk = decompressor.flush();
+ assert(progress + chunk.length <= originalData.length,
+ "The uncompressed result is bigger than the original data");
+
+ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[];
+ progress += chunk.length;
+
+ assert(progress == originalData.length,
+ "The uncompressed and the original data sizes differ");
+ assert(originalData[] == uncompressedData[],
+ "The uncompressed and the original data differ");
+ }
+
+ @system unittest
+ {
+ ubyte[1024] invalidData;
+ auto decompressor = new UnCompress();
+
+ try
+ {
+ auto uncompressedData = decompressor.uncompress(invalidData);
+ }
+ catch (ZlibException e)
+ {
+ assert(e.msg == "data error");
+ return;
+ }
+
+ assert(false, "Corrupted data didn't result in an error");
+ }
+
+ @system unittest
+ {
+ ubyte[2014] originalData = void;
+ auto compressedData = compress(originalData, 9);
+
+ auto decompressor = new UnCompress();
+ auto uncompressedData = decompressor.uncompress(compressedData ~ cast(ubyte[]) "whatever");
+
+ assert(originalData.length == uncompressedData.length,
+ "The uncompressed and the original data sizes differ");
+ assert(originalData[] == uncompressedData[],
+ "The uncompressed and the original data differ");
+ assert(!decompressor.uncompress("whatever").length,
+ "Compression continued after the end");
+ }
+
/**
* Decompress and return any remaining data.
* The returned data should be appended to that returned by uncompress().
@@ -626,49 +761,40 @@ class UnCompress
void[] flush()
in
{
- assert(!done);
+ assert(!done, "Buffer has been flushed before.");
}
out
{
- assert(done);
+ assert(done, "Flushing failed.");
}
- body
+ do
{
- import core.memory : GC;
- ubyte[] extra;
- ubyte[] destbuf;
- int err;
-
done = 1;
- if (!inited)
- return null;
+ return null;
+ }
- L1:
- destbuf = new ubyte[zs.avail_in * 2 + 100];
- zs.next_out = destbuf.ptr;
- zs.avail_out = to!uint(destbuf.length);
+ /// Returns true if all input data has been decompressed and no further data
+ /// can be decompressed (inflate() returned Z_STREAM_END)
+ @property bool empty() const
+ {
+ return inputEnded;
+ }
- err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH);
- if (err == Z_OK && zs.avail_out == 0)
- {
- extra ~= destbuf;
- goto L1;
- }
- if (err != Z_STREAM_END)
- {
- GC.free(destbuf.ptr);
- if (err == Z_OK)
- err = Z_BUF_ERROR;
- error(err);
- }
- destbuf = destbuf.ptr[0 .. zs.next_out - destbuf.ptr];
- err = etc.c.zlib.inflateEnd(&zs);
- inited = 0;
- if (err)
- error(err);
- if (extra.length)
- destbuf = extra ~ destbuf;
- return destbuf;
+ ///
+ @system unittest
+ {
+ // some random data
+ ubyte[1024] originalData = void;
+
+ // append garbage data (or don't, this works in both cases)
+ auto compressedData = cast(ubyte[]) compress(originalData) ~ cast(ubyte[]) "whatever";
+
+ auto decompressor = new UnCompress();
+ auto uncompressedData = decompressor.uncompress(compressedData);
+
+ assert(uncompressedData[] == originalData[],
+ "The uncompressed and the original data differ");
+ assert(decompressor.empty, "The UnCompressor reports not being done");
}
}
--
2.35.1

View file

@ -1,4 +1,4 @@
From ad053bc46b535e78397f992e3c2c1d28c1ebd1f4 Mon Sep 17 00:00:00 2001
From a547632f5c7caec4a164e8d5e5b568fb7a461365 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
@ -8,10 +8,10 @@ Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 047be0255e2..426949aa91c 100644
index 593495e1650..b96f60e33e2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -170,6 +170,7 @@ BUILD_EXPORTS = \
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
# built for the build system to override those in BASE_FLAGS_TO_PASS.
EXTRA_BUILD_FLAGS = \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
@ -19,6 +19,3 @@ index 047be0255e2..426949aa91c 100644
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
--
2.35.1

View file

@ -1,4 +1,4 @@
From 18d44a7f8d801cc6926a73e2dda2f0ce859dc561 Mon Sep 17 00:00:00 2001
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d 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
@ -8,10 +8,10 @@ Subject: [PATCH] add fortify-headers paths
1 file changed, 2 insertions(+)
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 4e1db60fced..7fcf402b416 100644
index 74f70793d90..61b07f319f6 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -167,6 +167,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
@ -20,6 +20,3 @@ index 4e1db60fced..7fcf402b416 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.35.1

View file

@ -1,38 +0,0 @@
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
---
libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
index 59df921ba41..9ee9f943948 100644
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
@@ -871,6 +871,21 @@ else version (CRuntime_Musl)
F_SETLKW = 7,
}
}
+ else version (MIPS_Any)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x008000, // octal 0100000
+ O_LARGEFILE = 0x002000, // octal 0020000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 33,
+ F_SETLK = 34,
+ F_SETLKW = 35,
+ }
+ }
else
static assert(0, "Platform not supported");
--
2.35.1

View file

@ -1,4 +1,4 @@
From 38d27ebdcc5a8bea0807b5d56203f0ea5e16868f Mon Sep 17 00:00:00 2001
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 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
@ -9,14 +9,14 @@ Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
stack-protector flag usage.
---
gcc/gcc.c | 3 +--
gcc/gcc.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 99314032ec2..6e91767efe8 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -997,8 +997,7 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index cc99d0b7aa1..c60a75371f8 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
@ -26,6 +26,3 @@ index 99314032ec2..6e91767efe8 100644
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.35.1

View file

@ -1,18 +1,18 @@
From 0cc2a1befaf343e5ce1cbc15bd247eee812bdf33 Mon Sep 17 00:00:00 2001
From bbd5c529ef878c2d6096fd4949616714eb82683a 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
linking libtsan.
---
gcc/gcc.c | 16 ++++++++--------
gcc/gcc.cc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 6e91767efe8..22dbbf85850 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -738,10 +738,10 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c60a75371f8..735b2b1bba1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -745,10 +745,10 @@ proper position among the other output files. */
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
@ -25,7 +25,7 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -777,10 +777,10 @@ proper position among the other output files. */
@@ -784,10 +784,10 @@ proper position among the other output files. */
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
@ -38,7 +38,7 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -798,10 +798,10 @@ proper position among the other output files. */
@@ -805,10 +805,10 @@ proper position among the other output files. */
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
@ -51,7 +51,7 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -817,10 +817,10 @@ proper position among the other output files. */
@@ -824,10 +824,10 @@ proper position among the other output files. */
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
@ -64,6 +64,3 @@ index 6e91767efe8..22dbbf85850 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.35.1

View file

@ -1,4 +1,4 @@
From feea6f782e83a53487ad633608484dfa3483be1b Mon Sep 17 00:00:00 2001
From 714ed6d9649bf9ed42e34fef9c41169921e63921 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
@ -10,10 +10,10 @@ multilib is not supported by Alpine GCC
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 47aac9d3d61..4ad81059a86 100644
index 858bbba3a36..2d4f553e652 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3425,11 +3425,11 @@ struct GTY(()) machine_function {
@@ -3447,11 +3447,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
@ -30,7 +30,7 @@ index 47aac9d3d61..4ad81059a86 100644
/* Load store bonding is not supported by micromips and fix_24k. The
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 130e1f04707..a64ac2bbb5b 100644
index 2fdd8e00407..406a3676289 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
@ -43,6 +43,3 @@ index 130e1f04707..a64ac2bbb5b 100644
+ ../lib \
+ ../lib32 \
+ ../lib
--
2.35.1

View file

@ -1,4 +1,4 @@
From cbd96a32dc2aaa61f6adcb3643e1da21f185f80e Mon Sep 17 00:00:00 2001
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b 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
@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
index 241b0ef20b6..18e63b34d8b 100644
index d0cd546002a..b63a77f4969 100644
--- a/gcc/config/aarch64/t-aarch64-linux
+++ b/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
@ -21,6 +21,3 @@ index 241b0ef20b6..18e63b34d8b 100644
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.35.1

View file

@ -1,4 +1,4 @@
From e87e415e9a88dbce68ed7b9d8386c3c2d0c0d6b6 Mon Sep 17 00:00:00 2001
From 65ad898df141261a1ccd891a99133ad8f9847133 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
@ -20,6 +20,3 @@ index cc6ab367072..7f498ee1cdc 100644
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.35.1

View file

@ -1,4 +1,4 @@
From 5c24869c9bc1a552f8bb5c32a8538c6e065a4db8 Mon Sep 17 00:00:00 2001
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be 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
@ -12,7 +12,7 @@ multilib is not presently supported on Alpine GCC
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
index aeb7440c492..ab14c455d8d 100644
index 4e371255533..128c75c7d39 100644
--- a/gcc/config/rs6000/t-linux
+++ b/gcc/config/rs6000/t-linux
@@ -2,7 +2,8 @@
@ -36,7 +36,7 @@ index aeb7440c492..ab14c455d8d 100644
endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index e11a118cb5f..df81dc04a32 100644
index 47e0efd5764..f89729af64f 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
@ -48,7 +48,7 @@ index e11a118cb5f..df81dc04a32 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc
$(COMPILE) $<
diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele
index 97c1ee6fb4d..08d72639cb6 100644
@ -76,6 +76,3 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.35.1

View file

@ -1,4 +1,4 @@
From 25927f8106583ee594e7bcdf92dd1387e0fd024c Mon Sep 17 00:00:00 2001
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 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
@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index d288b093522..2949033aa04 100644
index 5526ad0e6cc..78866afab36 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -33,6 +33,6 @@
@ -21,6 +21,3 @@ index d288b093522..2949033aa04 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.35.1

View file

@ -1,4 +1,4 @@
From 18bcf23cae4069ffe9d9f64e851193d29dd4814f Mon Sep 17 00:00:00 2001
From 2eed19787020ce52cf07b76a5d167c420ec42b61 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
@ -43,7 +43,7 @@ library.
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index ee29979dd34..fe8a82d6702 100644
index 3067ed6eac8..4c8c85e3285 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
@ -69,6 +69,3 @@ index 216d2776a18..1a8a863853e 100644
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.35.1

View file

@ -1,4 +1,4 @@
From a46c8d6cb9428db29fbf8a80609ff449354ce111 Mon Sep 17 00:00:00 2001
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a 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
@ -10,7 +10,7 @@ highly inspired by:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 2c8be561eb5..c557750b1b3 100644
index 09b3ec8bc2e..c9ca58c64cc 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
@ -46,6 +46,3 @@ index 2c8be561eb5..c557750b1b3 100644
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.35.1

View file

@ -1,4 +1,4 @@
From d7064ab25a561bb99c3d0b35663154656013aed2 Mon Sep 17 00:00:00 2001
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 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
@ -9,10 +9,10 @@ Subject: [PATCH] ada: libgnarl compatibility for musl
2 files changed, 3 insertions(+), 61 deletions(-)
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
index 2272f83d68d..1d78456544a 100644
index 7c9e7ca4518..caafc4aa68f 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -401,12 +401,6 @@ package System.OS_Interface is
@@ -403,12 +403,6 @@ package System.OS_Interface is
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
@ -25,7 +25,7 @@ index 2272f83d68d..1d78456544a 100644
function pthread_rwlock_init
(mutex : access pthread_rwlock_t;
attr : access pthread_rwlockattr_t) return int;
@@ -468,11 +462,6 @@ package System.OS_Interface is
@@ -470,11 +464,6 @@ package System.OS_Interface is
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
@ -38,7 +38,7 @@ index 2272f83d68d..1d78456544a 100644
sched_priority : int; -- scheduling priority
end record;
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 757a6cdfdad..82df94f6a00 100644
index 4ff784f0ea7..b34a12802c6 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
@ -130,6 +130,3 @@ index 757a6cdfdad..82df94f6a00 100644
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
--
2.35.1

View file

@ -1,4 +1,4 @@
From 5193de0a6c96fefe0c46fc9a6b8c27623ad85640 Mon Sep 17 00:00:00 2001
From 82addb1312f4f58a412a664228944009aa5cb569 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,10 +11,10 @@ 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 b5b8b573ea4..6fce40d1e98 100644
index aaf853e3a2a..e2dd3587ed5 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))),)
@@ -1633,7 +1633,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -23,7 +23,7 @@ index b5b8b573ea4..6fce40d1e98 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2355,7 +2355,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2258,7 +2258,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -32,7 +32,7 @@ index b5b8b573ea4..6fce40d1e98 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2386,7 +2386,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2289,7 +2289,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@ -41,7 +41,7 @@ index b5b8b573ea4..6fce40d1e98 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2597,7 +2597,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2504,7 +2504,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -50,7 +50,7 @@ index b5b8b573ea4..6fce40d1e98 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2700,7 +2700,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2608,7 +2608,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) \
@ -60,7 +60,7 @@ index b5b8b573ea4..6fce40d1e98 100644
$(X86_64_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 2e54e69643a..e7e6507e2e0 100644
index 591d033fbca..a485cbf15b9 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@ -75,7 +75,7 @@ index 2e54e69643a..e7e6507e2e0 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3442,7 +3447,6 @@ __gnat_lwp_self (void)
@@ -3446,7 +3451,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@ -83,7 +83,7 @@ index 2e54e69643a..e7e6507e2e0 100644
/* glibc versions earlier than 2.7 do not define the routines to handle
dynamically allocated CPU sets. For these targets, we use the static
@@ -3452,7 +3456,7 @@ __gnat_lwp_self (void)
@@ -3456,7 +3460,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@ -92,7 +92,7 @@ index 2e54e69643a..e7e6507e2e0 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3465,33 +3469,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3469,33 +3473,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@ -134,7 +134,7 @@ index 2e54e69643a..e7e6507e2e0 100644
}
size_t
@@ -3501,23 +3505,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3505,23 +3509,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@ -164,10 +164,10 @@ index 2e54e69643a..e7e6507e2e0 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 85997b9ba68..fd10e5b5589 100644
index 2631be5ad3e..d442f4bd6cd 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -325,13 +325,11 @@ extern void *__gnat_lwp_self (void);
@@ -321,13 +321,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@ -186,7 +186,7 @@ index 85997b9ba68..fd10e5b5589 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index ec9db3a6a4c..6f92e50dd67 100644
index 32d30a49c7e..d960e32e2d0 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@ -218,6 +218,3 @@ index ec9db3a6a4c..6f92e50dd67 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.35.1

View file

@ -1,4 +1,4 @@
From 8a42d93247c375f199f3079538d659f95b9ff2a0 Mon Sep 17 00:00:00 2001
From 7feb681596c4cfa34c769505058aa5bdf31c5131 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
@ -8,14 +8,14 @@ Content-Transfer-Encoding: 8bit
Taken from Adélie Linux.
---
libgo/mksigtab.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
libgo/mksigtab.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh
index 11e4ec436bd..fe866eacb27 100644
index bea8739957e..3876002efab 100644
--- a/libgo/mksigtab.sh
+++ b/libgo/mksigtab.sh
@@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}'
@@ -86,7 +86,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}'
checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}'
checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}'
checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}'
@ -24,20 +24,3 @@ index 11e4ec436bd..fe866eacb27 100644
checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
checksig _SIGLWP '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
checksig _SIGFREEZE '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
@@ -95,10 +95,12 @@ checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
# Special handling of signals 32 and 33 on GNU/Linux systems,
# because they are special to glibc.
+# Signal 34 is additionally special to Linux systems with musl.
if test "${GOOS}" = "linux"; then
- SIGLIST=$SIGLIST"_32__33_"
+ SIGLIST=$SIGLIST"_32__33__34_"
echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
+ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
fi
if test "${GOOS}" = "aix"; then
--
2.35.1

View file

@ -1,4 +1,4 @@
From c205f79c18add13247a06cfd843f5eb44c4c3cb4 Mon Sep 17 00:00:00 2001
From b6885cf73989161b1b6893b5ae0dafed006d5f13 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
@ -22,6 +22,3 @@ index 0c52ea5d71a..6fef104cc1c 100755
if test "${GOOS}" = "netbsd"; then
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi
--
2.35.1

View file

@ -1,4 +1,4 @@
From 6e41b6753af412388e9259fe791904146695e84e Mon Sep 17 00:00:00 2001
From c7a22e42ae403154a0c0158495b04b0205102041 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
@ -8,7 +8,7 @@ Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c
1 file changed, 4 insertions(+)
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 38bf7a6b255..e50403b5a75 100644
index 3a30748d329..a987678fa84 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -66,6 +66,10 @@ static void gscanstack(G*);
@ -22,6 +22,3 @@ index 38bf7a6b255..e50403b5a75 100644
#ifndef SETCONTEXT_CLOBBERS_TLS
static inline void
--
2.35.1

View file

@ -1,4 +1,4 @@
From cc89c078ffc58a7f6675a60fbca24224effcb7e3 Mon Sep 17 00:00:00 2001
From ef9df74e0c1059e51bb76b1f6d9d4746949d4d34 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
@ -8,10 +8,10 @@ Subject: [PATCH] gcc-go: link to libucontext
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 426949aa91c..f97db1ef569 100644
index b96f60e33e2..b564ddbf792 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -50331,7 +50331,7 @@ configure-target-libgo:
@@ -52802,7 +52802,7 @@ configure-target-libgo:
esac; \
module_srcdir=libgo; \
rm -f no-such-file || : ; \
@ -20,6 +20,3 @@ index 426949aa91c..f97db1ef569 100644
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.35.1

View file

@ -1,4 +1,4 @@
From 3fb914ca83ac18287ee24aa75aba9149e35487ad Mon Sep 17 00:00:00 2001
From 5093aa99f9cdded2e1ddf67b7139da6fac36b0a6 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
@ -43,6 +43,3 @@ index 5b19e6f202d..8dc60172186 100644
package syscall
--
2.35.1

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