aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-08-21 01:49:25 -0600
committerAriadne Conill <ariadne@dereferenced.org>2020-08-21 01:50:37 -0600
commit4941197042bc2f91ad07e83a482e7f3351860064 (patch)
tree00ee89806ea459cdfbd5015bc6a467ec8dfe16c3 /main
parent5e46ac7fe14755a965e972a74302b32a1e29156e (diff)
downloadaports-4941197042bc2f91ad07e83a482e7f3351860064.tar.gz
aports-4941197042bc2f91ad07e83a482e7f3351860064.tar.bz2
aports-4941197042bc2f91ad07e83a482e7f3351860064.tar.xz
main/gcc: upgrade to 10.2.0
Diffstat (limited to 'main')
-rw-r--r--main/gcc/0001-posix_memalign.patch (renamed from main/gcc/0002-posix_memalign.patch)8
-rw-r--r--main/gcc/0002-gcc-poison-system-directories.patch (renamed from main/gcc/0003-gcc-poison-system-directories.patch)65
-rw-r--r--main/gcc/0003-Turn-on-Wl-z-relro-z-now-by-default.patch39
-rw-r--r--main/gcc/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch (renamed from main/gcc/003_all_default-fortify-source.patch)52
-rw-r--r--main/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch (renamed from main/gcc/005_all_default-as-needed.patch)383
-rw-r--r--main/gcc/0006-Enable-Wformat-and-Wformat-security-by-default.patch (renamed from main/gcc/011_all_default-warn-format-security.patch)26
-rw-r--r--main/gcc/0007-Enable-Wtrampolines-by-default.patch25
-rw-r--r--main/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch53
-rw-r--r--main/gcc/0008-s390x-muslldso.patch26
-rw-r--r--main/gcc/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch (renamed from main/gcc/020_all_msgfmt-libstdc++-link.patch)29
-rw-r--r--main/gcc/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch28
-rw-r--r--main/gcc/0010-ldbl128-config.patch76
-rw-r--r--main/gcc/0011-libiberty-copy-PIC-objects-during-build-process.patch24
-rw-r--r--main/gcc/0012-libitm-disable-FORTIFY.patch (renamed from main/gcc/053_all_libitm-no-fortify-source.patch)20
-rw-r--r--main/gcc/0012-static-pie.patch107
-rw-r--r--main/gcc/0013-libgcc_s.patch (renamed from main/gcc/203-libgcc_s.patch)28
-rw-r--r--main/gcc/0014-nopie.patch (renamed from main/gcc/205-nopie.patch)14
-rw-r--r--main/gcc/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch25
-rw-r--r--main/gcc/0016-dlang-update-zlib-binding.patch (renamed from main/gcc/404-dlang-zlib.patch)28
-rw-r--r--main/gcc/0016-invalid_tls_model.patch29
-rw-r--r--main/gcc/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch51
-rw-r--r--main/gcc/0018-ada-fix-shared-linking.patch (renamed from main/gcc/ada-shared.patch)26
-rw-r--r--main/gcc/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch24
-rw-r--r--main/gcc/0020-libstdc-futex-add-time64-compatibility.patch32
-rw-r--r--main/gcc/0021-add-fortify-headers-paths.patch25
-rw-r--r--main/gcc/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch31
-rw-r--r--main/gcc/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch (renamed from main/gcc/gcc-as-needed-gold.patch)25
-rw-r--r--main/gcc/0024-Pure-64-bit-MIPS.patch (renamed from main/gcc/gcc-pure64-mips.patch)12
-rw-r--r--main/gcc/0025-use-pure-64-bit-configuration-where-appropriate.patch (renamed from main/gcc/gcc-pure64.patch)100
-rw-r--r--main/gcc/0026-always-build-libgcc_eh.a.patch (renamed from main/gcc/libgcc-always-build-gcceh.a.patch)32
-rw-r--r--main/gcc/0027-ada-libgnarl-compatibility-for-musl.patch (renamed from main/gcc/libgnarl-musl.patch)41
-rw-r--r--main/gcc/0028-ada-musl-support-fixes.patch (renamed from main/gcc/ada-musl.patch)137
-rw-r--r--main/gcc/002_all_default-relro.patch33
-rw-r--r--main/gcc/012_all_default-warn-trampolines.patch13
-rw-r--r--main/gcc/013_all_default-ssp-fix.patch38
-rw-r--r--main/gcc/050_all_libiberty-asprintf.patch18
-rw-r--r--main/gcc/051_all_libiberty-pic.patch10
-rw-r--r--main/gcc/090_all_pr55930-dependency-tracking.patch18
-rw-r--r--main/gcc/320-libffi-gnulinux.patch13
-rw-r--r--main/gcc/400-dlang-phobos.patch1216
-rw-r--r--main/gcc/401-dlang-32bits.patch25
-rw-r--r--main/gcc/402-dlang-stat.patch448
-rw-r--r--main/gcc/403-dlang-ibmz.patch137
-rw-r--r--main/gcc/405-dlang-mips.patch34
-rw-r--r--main/gcc/406-dlang-fix-interface-visibility.patch22
-rw-r--r--main/gcc/APKBUILD144
-rw-r--r--main/gcc/fix-cxxflags-passing.patch10
-rw-r--r--main/gcc/futex-time64.patch21
-rw-r--r--main/gcc/gcc-4.9-musl-fortify.patch11
-rw-r--r--main/gcc/gcc-6.1-musl-libssp.patch20
50 files changed, 1023 insertions, 2829 deletions
diff --git a/main/gcc/0002-posix_memalign.patch b/main/gcc/0001-posix_memalign.patch
index 874f49b9b0..e15a353baa 100644
--- a/main/gcc/0002-posix_memalign.patch
+++ b/main/gcc/0001-posix_memalign.patch
@@ -1,14 +1,14 @@
-From 65eb86f3e110998d30489df009d44b4bc1043adc Mon Sep 17 00:00:00 2001
+From 399f9e74a691ca6272d460d72d1b47afcad84752 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
-Subject: [PATCH 02/12] posix_memalign
+Subject: [PATCH 01/28] posix_memalign
---
gcc/config/i386/pmm_malloc.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
-index ffbb7f82cf5..b0b890d2403 100644
+index 87344d9383f..ece428df487 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@@ -38,5 +38,5 @@ index ffbb7f82cf5..b0b890d2403 100644
else
return NULL;
--
-2.17.1
+2.27.0
diff --git a/main/gcc/0003-gcc-poison-system-directories.patch b/main/gcc/0002-gcc-poison-system-directories.patch
index 0d6d964d3e..6d286ceda2 100644
--- a/main/gcc/0003-gcc-poison-system-directories.patch
+++ b/main/gcc/0002-gcc-poison-system-directories.patch
@@ -1,11 +1,20 @@
-From 48c670d2678e0323d88eb72205e039f393cabe05 Mon Sep 17 00:00:00 2001
+From 0e993b1b9a33910193862d76facf34bdbe58ed01 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 03/39] gcc: poison-system-directories
+Subject: [PATCH 02/28] gcc: poison-system-directories
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch. The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan. If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Inappropriate [distribution: codesourcery]
+Upstream-Status: Pending
---
gcc/common.opt | 4 ++++
gcc/config.in | 6 ++++++
@@ -13,14 +22,14 @@ Upstream-Status: Inappropriate [distribution: codesourcery]
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
- gcc/incpath.c | 19 +++++++++++++++++++
- 7 files changed, 66 insertions(+)
+ gcc/incpath.c | 21 +++++++++++++++++++++
+ 7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
-index d6ef85928f3..7b29efe3882 100644
+index 3ec7743eae8..d3c3e51dcb0 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
-@@ -679,6 +679,10 @@ Wreturn-local-addr
+@@ -682,6 +682,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.
@@ -32,10 +41,10 @@ index d6ef85928f3..7b29efe3882 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 5bccb408016..1c784a8276b 100644
+index 364eba47737..9551c0dfdf9 100644
--- a/gcc/config.in
+++ b/gcc/config.in
-@@ -194,6 +194,12 @@
+@@ -224,6 +224,12 @@
#endif
@@ -49,10 +58,10 @@ index 5bccb408016..1c784a8276b 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 5c345ce0fd7..cafd05fd150 100755
+index eb6061c1631..90e3be864f8 100755
--- a/gcc/configure
+++ b/gcc/configure
-@@ -953,6 +953,7 @@ with_system_zlib
+@@ -1010,6 +1010,7 @@ with_system_zlib
enable_maintainer_mode
enable_link_mutex
enable_version_specific_runtime_libs
@@ -60,7 +69,7 @@ index 5c345ce0fd7..cafd05fd150 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
-@@ -1696,6 +1697,8 @@ Optional Features:
+@@ -1766,6 +1767,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@@ -69,7 +78,7 @@ index 5c345ce0fd7..cafd05fd150 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
-@@ -29715,6 +29718,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
+@@ -30266,6 +30269,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@@ -90,10 +99,10 @@ index 5c345ce0fd7..cafd05fd150 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
-index 65dbf1f2f80..dd5b38195ce 100644
+index 715fcba0482..f42006e5476 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -6341,6 +6341,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
+@@ -6600,6 +6600,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@@ -111,18 +120,18 @@ index 65dbf1f2f80..dd5b38195ce 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
-index 255149fcfb8..cb71b60fe3c 100644
+index a2794a67d1e..dfed8fd25a8 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
-@@ -303,6 +303,7 @@ Objective-C and Objective-C++ Dialects}.
- -Wpacked -Wpacked-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
+@@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
- -Wplacement-new -Wplacement-new=@var{n} @gol
+ -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
- -Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast @gol
- -Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol
- -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
-@@ -5712,6 +5713,14 @@ made up of data only and thus requires no special treatment. But, for
+ -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
+ -Wrestrict -Wno-return-local-addr -Wreturn-type @gol
+ -Wno-scalar-storage-order -Wsequence-point @gol
+@@ -6924,6 +6925,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.
@@ -138,11 +147,11 @@ index 255149fcfb8..cb71b60fe3c 100644
@opindex Wfloat-equal
@opindex Wno-float-equal
diff --git a/gcc/gcc.c b/gcc/gcc.c
-index a716f708259..02b3cd39fc2 100644
+index 9f790db0daf..b2200c5185a 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
-@@ -1061,6 +1060,8 @@
- "-z relro -z now " \
+@@ -1041,6 +1041,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}}} \
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
@@ -151,7 +160,7 @@ index a716f708259..02b3cd39fc2 100644
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 b11c6a57939..e3b7a21966f 100644
+index 8a2bda00f80..9098ab044ab 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -26,6 +26,7 @@
@@ -190,5 +199,5 @@ index b11c6a57939..e3b7a21966f 100644
/* Use given -I paths for #include "..." but not #include <...>, and
--
-2.17.0
+2.27.0
diff --git a/main/gcc/0003-Turn-on-Wl-z-relro-z-now-by-default.patch b/main/gcc/0003-Turn-on-Wl-z-relro-z-now-by-default.patch
new file mode 100644
index 0000000000..6253f91096
--- /dev/null
+++ b/main/gcc/0003-Turn-on-Wl-z-relro-z-now-by-default.patch
@@ -0,0 +1,39 @@
+From a35a55940c3402f8ebb510ec7d8bc67e85051277 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:45:49 +0000
+Subject: [PATCH 03/28] Turn on -Wl,-z,relro,-z,now by default.
+
+---
+ gcc/doc/invoke.texi | 3 +++
+ gcc/gcc.c | 1 +
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index dfed8fd25a8..ca56d52cb05 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -14638,6 +14638,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}.
+
++NOTE: In Alpine Linux, for LDFLAGS, the option
++@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
++
+ @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 b2200c5185a..625c9ab7902 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1039,6 +1039,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 \
++ "-z relro -z now " \
+ "%X %{o*} %{e*} %{N} %{n} %{r}\
+ %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
+ %{Wno-poison-system-directories:--no-poison-system-directories} \
+--
+2.27.0
+
diff --git a/main/gcc/003_all_default-fortify-source.patch b/main/gcc/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
index 6ca8033430..b713eccdad 100644
--- a/main/gcc/003_all_default-fortify-source.patch
+++ b/main/gcc/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
@@ -1,16 +1,34 @@
-# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
-# DP: if the optimization level is > 0
+From d2865d0a184ef59be8893dd34edf5037c4bf48f7 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:46:22 +0000
+Subject: [PATCH 04/28] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
+ ObjC, ObjC++, if the optimization level is > 0
---
- gcc/doc/invoke.texi | 6 ++++++
- gcc/c-family/c-cppbuiltin.c | 3 +
- 2 files changed, 9 insertions(+), 0 deletions(-)
+ gcc/c-family/c-cppbuiltin.c | 4 ++++
+ gcc/doc/invoke.texi | 6 ++++++
+ 2 files changed, 10 insertions(+)
-Index: b/gcc/doc/invoke.texi
-===================================================================
+diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
+index db91a36794a..ed976c71404 100644
+--- a/gcc/c-family/c-cppbuiltin.c
++++ b/gcc/c-family/c-cppbuiltin.c
+@@ -1385,6 +1385,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);
+
++ /* Fortify Source enabled by default for optimization levels > 0 */
++ if (optimize)
++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
++
+ /* Misc. */
+ if (flag_gnu89_inline)
+ cpp_define (pfile, "__GNUC_GNU_INLINE__");
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index ca56d52cb05..f5d5a1d1542 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
-@@ -7840,6 +7840,12 @@ also turns on the following optimization
+@@ -9228,6 +9228,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.
@@ -23,18 +41,6 @@ Index: b/gcc/doc/invoke.texi
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
-Index: b/gcc/c-family/c-cppbuiltin.c
-===================================================================
---- a/gcc/c-family/c-cppbuiltin.c
-+++ b/gcc/c-family/c-cppbuiltin.c
-@@ -1176,6 +1176,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);
-
-+ /* Fortify Source enabled by default for optimization levels > 0 */
-+ if (optimize)
-+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
-+
- /* Misc. */
- if (flag_gnu89_inline)
- cpp_define (pfile, "__GNUC_GNU_INLINE__");
+--
+2.27.0
+
diff --git a/main/gcc/005_all_default-as-needed.patch b/main/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
index 2eced0f06c..03a995b07f 100644
--- a/main/gcc/005_all_default-as-needed.patch
+++ b/main/gcc/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
@@ -1,71 +1,68 @@
-# DP: On linux targets pass --as-needed by default to the linker, but always
-# DP: link the sanitizer libraries with --no-as-needed.
+From 872e0a15a2b74cd6b6ba58e2e7e1605543ea36bd Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:46:56 +0000
+Subject: [PATCH 05/28] On linux targets pass --as-needed by default to the
+ linker, but always link the sanitizer libraries with --no-as-needed.
-Index: b/gcc/gcc.c
-===================================================================
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -692,8 +692,11 @@ proper position among the other output f
- #ifdef LIBASAN_EARLY_SPEC
- #define LIBASAN_SPEC STATIC_LIBASAN_LIBS
- #elif defined(HAVE_LD_STATIC_DYNAMIC)
--#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
-- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
-+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
-+ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
-+ " -lasan " \
-+ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
-+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
- STATIC_LIBASAN_LIBS
- #else
- #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
-@@ -710,8 +713,11 @@ proper position among the other output f
- #ifdef LIBTSAN_EARLY_SPEC
- #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
- #elif defined(HAVE_LD_STATIC_DYNAMIC)
--#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
-- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
-+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
-+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
-+ " -ltsan " \
-+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
-+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
- STATIC_LIBTSAN_LIBS
- #else
- #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
-@@ -728,8 +734,11 @@ proper position among the other output f
- #ifdef LIBLSAN_EARLY_SPEC
- #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
- #elif defined(HAVE_LD_STATIC_DYNAMIC)
--#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
-- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
-+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
-+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
-+ " -llsan " \
-+ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
-+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
- STATIC_LIBLSAN_LIBS
- #else
- #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
-@@ -744,8 +753,11 @@ proper position among the other output f
- #define STATIC_LIBUBSAN_LIBS \
- " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
- #ifdef HAVE_LD_STATIC_DYNAMIC
--#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
-- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
-+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
-+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
-+ " -lubsan " \
-+ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
-+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
- STATIC_LIBUBSAN_LIBS
- #else
- #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
-Index: b/gcc/config/gnu-user.h
-===================================================================
+---
+ gcc/config/aarch64/aarch64-linux.h | 1 +
+ gcc/config/alpha/linux-elf.h | 2 +-
+ gcc/config/arm/linux-elf.h | 1 +
+ gcc/config/gnu-user.h | 6 +++---
+ gcc/config/i386/gnu-user.h | 2 +-
+ gcc/config/i386/gnu-user64.h | 1 +
+ gcc/config/ia64/linux.h | 2 +-
+ gcc/config/mips/gnu-user.h | 1 +
+ gcc/config/riscv/linux.h | 1 +
+ gcc/config/rs6000/linux64.h | 4 ++--
+ gcc/config/rs6000/sysv4.h | 2 +-
+ gcc/config/s390/linux.h | 2 +-
+ gcc/config/sparc/linux.h | 2 +-
+ gcc/gcc.c | 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 e587e2e9ad6..1d1017aa523 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -35,6 +35,7 @@
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} \
++ --as-needed \
+ %{static:-Bstatic} \
+ %{shared:-shared} \
+ %{symbolic:-Bsymbolic} \
+diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index e25fcac3c59..22b2f7b0d14 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
+
+ #define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
+
+-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
++#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
+ %{O*:-O3} %{!O*:-O1} \
+ %{shared:-shared} \
+ %{!shared: \
+diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 0ec3aa53189..f8bda84de2a 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -70,6 +70,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
+ -X \
++ --as-needed \
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
+index ff2e880b1fa..7f30c363e4a 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
-@@ -161,15 +161,15 @@ see the files COPYING3 and COPYING.RUNTI
+@@ -136,17 +136,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
"%{static-libasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
@@ -84,20 +81,35 @@ Index: b/gcc/config/gnu-user.h
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#endif
-Index: b/gcc/config/aarch64/aarch64-linux.h
-===================================================================
---- a/gcc/config/aarch64/aarch64-linux.h
-+++ b/gcc/config/aarch64/aarch64-linux.h
-@@ -35,6 +35,7 @@
- #define CPP_SPEC "%{pthread:-D_REENTRANT}"
- #define LINUX_TARGET_LINK_SPEC "%{h*} \
-+ --as-needed \
- %{static:-Bstatic} \
- %{shared:-shared} \
- %{symbolic:-Bsymbolic} \
-Index: b/gcc/config/ia64/linux.h
-===================================================================
+ #undef TARGET_F951_OPTIONS
+diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
+index ae4aa844f02..54b91c0492a 100644
+--- a/gcc/config/i386/gnu-user.h
++++ b/gcc/config/i386/gnu-user.h
+@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. If not see
+ { "link_emulation", GNU_USER_LINK_EMULATION },\
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+
+-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
++#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{!static-pie: \
+diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
+index 785c68220b8..21dd66b412a 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
+ "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
+ %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
+ %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
++ --as-needed \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
+index ee38e218aec..0325971d818 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@@ -109,37 +121,35 @@ Index: b/gcc/config/ia64/linux.h
%{shared:-shared} \
%{!shared: \
%{!static: \
-Index: b/gcc/config/sparc/linux.h
-===================================================================
---- a/gcc/config/sparc/linux.h
-+++ b/gcc/config/sparc/linux.h
-@@ -86,7 +86,7 @@ extern const char *host_detect_local_cpu
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-
- #undef LINK_SPEC
--#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
-+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
- %{!mno-relax:%{!r:-relax}} \
+diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
+index 5d0782100bb..4be5fbb2191 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
+ #undef GNU_USER_TARGET_LINK_SPEC
+ #define GNU_USER_TARGET_LINK_SPEC "\
+ %{G*} %{EB} %{EL} %{mips*} %{shared} \
++ -as-needed \
%{!shared: \
%{!static: \
-Index: b/gcc/config/s390/linux.h
-===================================================================
---- a/gcc/config/s390/linux.h
-+++ b/gcc/config/s390/linux.h
-@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3.
+ %{rdynamic:-export-dynamic} \
+diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
+index 4afef7c228c..ba1a6e60e05 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
+ "%{mabi=ilp32:_ilp32}"
- #undef LINK_SPEC
- #define LINK_SPEC \
-- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
-+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
- %{shared:-shared} \
- %{!shared: \
- %{static:-static} \
-Index: b/gcc/config/rs6000/linux64.h
-===================================================================
+ #define LINK_SPEC "\
++-as-needed \
+ -melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
+ %{mno-relax:--no-relax} \
+ %{shared} \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 2ded3301282..a1e44ddcc0d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
-@@ -490,13 +490,13 @@ extern int dot_symbols;
+@@ -457,13 +457,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
@@ -155,90 +165,105 @@ Index: b/gcc/config/rs6000/linux64.h
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
-Index: b/gcc/config/rs6000/sysv4.h
-===================================================================
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index 9ade72114e9..9490b84a153 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
-@@ -811,7 +811,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
- MUSL_DYNAMIC_LINKER)
+@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC
+ #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
+ #endif
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
-Index: b/gcc/config/i386/gnu-user64.h
-===================================================================
---- a/gcc/config/i386/gnu-user64.h
-+++ b/gcc/config/i386/gnu-user64.h
-@@ -56,6 +56,7 @@
- "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
- %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
- %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
-+ --as-needed \
- %{shared:-shared} \
- %{!shared: \
- %{!static: \
-Index: b/gcc/config/i386/gnu-user.h
-===================================================================
---- a/gcc/config/i386/gnu-user.h
-+++ b/gcc/config/i386/gnu-user.h
-@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3.
- { "link_emulation", GNU_USER_LINK_EMULATION },\
- { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
-
--#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
-+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{!static-pie: \
-Index: b/gcc/config/alpha/linux-elf.h
-===================================================================
---- 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.
-
- #define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
+diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
+index 6919b468f06..56d52d41b31 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
--#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
-+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \
- %{O*:-O3} %{!O*:-O1} \
- %{shared:-shared} \
- %{!shared: \
-Index: b/gcc/config/arm/linux-elf.h
-===================================================================
---- a/gcc/config/arm/linux-elf.h
-+++ b/gcc/config/arm/linux-elf.h
-@@ -70,6 +70,7 @@
- %{rdynamic:-export-dynamic} \
- %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
- -X \
-+ --as-needed \
- %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
- SUBTARGET_EXTRA_LINK_SPEC
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
++ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
+ %{shared:-shared} \
+ %{!shared: \
+ %{static:-static} \
+diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index 81201e67a2f..6477d7ec52e 100644
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -87,7 +87,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-Index: b/gcc/config/mips/gnu-user.h
-===================================================================
---- 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.
- #undef GNU_USER_TARGET_LINK_SPEC
- #define GNU_USER_TARGET_LINK_SPEC "\
- %{G*} %{EB} %{EL} %{mips*} %{shared} \
-+ -as-needed \
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
++#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
+ %{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
- %{rdynamic:-export-dynamic} \
-Index: b/gcc/config/riscv/linux.h
-===================================================================
---- a/gcc/config/riscv/linux.h
-+++ b/gcc/config/riscv/linux.h
-@@ -58,6 +58,7 @@
- "%{mabi=ilp32:_ilp32}"
-
- #define LINK_SPEC "\
-+-as-needed \
- -melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
- %{mno-relax:--no-relax} \
- %{shared} \
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 625c9ab7902..7aec9d3a016 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -695,8 +695,11 @@ proper position among the other output files. */
+ #ifdef LIBASAN_EARLY_SPEC
+ #define LIBASAN_SPEC STATIC_LIBASAN_LIBS
+ #elif defined(HAVE_LD_STATIC_DYNAMIC)
+-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
+- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
++#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
++ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
++ " -lasan " \
++ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
++ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ STATIC_LIBASAN_LIBS
+ #else
+ #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
+@@ -713,8 +716,11 @@ proper position among the other output files. */
+ #ifdef LIBTSAN_EARLY_SPEC
+ #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
+ #elif defined(HAVE_LD_STATIC_DYNAMIC)
+-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
+- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
++#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
++ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
++ " -ltsan " \
++ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
++ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ STATIC_LIBTSAN_LIBS
+ #else
+ #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
+@@ -731,8 +737,11 @@ proper position among the other output files. */
+ #ifdef LIBLSAN_EARLY_SPEC
+ #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
+ #elif defined(HAVE_LD_STATIC_DYNAMIC)
+-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
+- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
++#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
++ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
++ " -llsan " \
++ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
++ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ STATIC_LIBLSAN_LIBS
+ #else
+ #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
+@@ -747,8 +756,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
+-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
+- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
++#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
++ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
++ " -lubsan " \
++ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
++ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ STATIC_LIBUBSAN_LIBS
+ #else
+ #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
+--
+2.27.0
+
diff --git a/main/gcc/011_all_default-warn-format-security.patch b/main/gcc/0006-Enable-Wformat-and-Wformat-security-by-default.patch
index f809abd9e7..4a25bbe6b5 100644
--- a/main/gcc/011_all_default-warn-format-security.patch
+++ b/main/gcc/0006-Enable-Wformat-and-Wformat-security-by-default.patch
@@ -1,9 +1,18 @@
-Enable -Wformat and -Wformat-security by default.
+From 5e20872b8cc916cb457c63c6cd970c4fcba47bbb Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:47:43 +0000
+Subject: [PATCH 06/28] Enable -Wformat and -Wformat-security by default.
---- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100
-+++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200
-@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit
- Warn about format strings that are not literals.
+---
+ gcc/c-family/c.opt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index c49da99d395..93f25319005 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -599,7 +599,7 @@ Warn about function calls with format strings that write past the end
+ of the destination region. Same as -Wformat-overflow=1.
Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
@@ -11,7 +20,7 @@ Enable -Wformat and -Wformat-security by default.
Warn about possible security problems with format functions.
Wformat-signedness
-@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l
+@@ -620,7 +620,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@@ -19,4 +28,7 @@ Enable -Wformat and -Wformat-security by default.
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
Warn about printf/scanf/strftime/strfmon format string anomalies.
- Wignored-qualifiers
+ Wformat-overflow=
+--
+2.27.0
+
diff --git a/main/gcc/0007-Enable-Wtrampolines-by-default.patch b/main/gcc/0007-Enable-Wtrampolines-by-default.patch
new file mode 100644
index 0000000000..5973e48290
--- /dev/null
+++ b/main/gcc/0007-Enable-Wtrampolines-by-default.patch
@@ -0,0 +1,25 @@
+From 1bcf7e30226852db956becebaffdfe2738923423 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:48:24 +0000
+Subject: [PATCH 07/28] Enable -Wtrampolines by default.
+
+---
+ gcc/common.opt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index d3c3e51dcb0..7b68397c232 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning
+ Do not suppress warnings from system headers.
+
+ Wtrampolines
+-Common Var(warn_trampolines) Warning
++Common Var(warn_trampolines) Init(1) Warning
+ Warn whenever a trampoline is generated.
+
+ Wtype-limits
+--
+2.27.0
+
diff --git a/main/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/main/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
new file mode 100644
index 0000000000..8fe4e86ee0
--- /dev/null
+++ b/main/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
@@ -0,0 +1,53 @@
+From 23fd86ff34670873dd294bd87b93f45c3624903a Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:49:40 +0000
+Subject: [PATCH 08/28] Disable ssp on -nostdlib, -nodefaultlibs and
+ -ffreestanding Change the buffer size.
+
+---
+ gcc/gcc.c | 8 +++++++-
+ gcc/params.opt | 2 +-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 7aec9d3a016..daeb4d0c8ea 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -886,6 +886,12 @@ proper position among the other output files. */
+ #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
+ #endif
+
++#ifdef ENABLE_DEFAULT_SSP
++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
++#else
++#define NO_SSP_SPEC ""
++#endif
++
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+@@ -1170,7 +1176,7 @@ static const char *cc1_options =
+ %{-version:--version}\
+ %{-help=*:--help=%*}\
+ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+- %{fsyntax-only:-o %j} %{-param*}\
++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
+ %{coverage:-fprofile-arcs -ftest-coverage}\
+ %{fprofile-arcs|fprofile-generate*|coverage:\
+ %{!fprofile-update=single:\
+diff --git a/gcc/params.opt b/gcc/params.opt
+index 4aec480798b..eaecfab37ad 100644
+--- a/gcc/params.opt
++++ b/gcc/params.opt
+@@ -853,7 +853,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=
+-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
+ The lower bound for a buffer to be considered for stack smashing protection.
+
+ -param=stack-clash-protection-guard-size=
+--
+2.27.0
+
diff --git a/main/gcc/0008-s390x-muslldso.patch b/main/gcc/0008-s390x-muslldso.patch
deleted file mode 100644
index 64833f308f..0000000000
--- a/main/gcc/0008-s390x-muslldso.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From b693804c8dba92fea7beee98f0aa520853a0532b Mon Sep 17 00:00:00 2001
-From: Szabolcs Nagy <nsz@port70.net>
-Date: Thu, 22 Dec 2016 11:22:28 +0000
-Subject: [PATCH 08/12] s390x muslldso
-
----
- gcc/config/s390/linux.h | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
-index 525c17c2c9f..2d4f4a0654e 100644
---- a/gcc/config/s390/linux.h
-+++ b/gcc/config/s390/linux.h
-@@ -76,6 +76,9 @@ along with GCC; see the file COPYING3. If not see
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
- #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
-
-+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
-+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
-+
- #undef LINK_SPEC
- #define LINK_SPEC \
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
---
-2.17.1
-
diff --git a/main/gcc/020_all_msgfmt-libstdc++-link.patch b/main/gcc/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
index a70ea50a07..5d50c31b1a 100644
--- a/main/gcc/020_all_msgfmt-libstdc++-link.patch
+++ b/main/gcc/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
@@ -1,4 +1,8 @@
-Ensure that msgfmt doesn't encounter problems during gcc bootstrapping.
+From d27d7936ecd9f357a3c6ee05e6548f8a68fdd4b7 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:50:33 +0000
+Subject: [PATCH 09/28] Ensure that msgfmt doesn't encounter problems during
+ gcc bootstrapping.
Solves error messages like the following:
@@ -16,10 +20,16 @@ library path, will make it work as expected here.
References:
https://bugs.gentoo.org/372377
https://bugs.gentoo.org/295480
+---
+ libstdc++-v3/po/Makefile.am | 1 +
+ libstdc++-v3/po/Makefile.in | 1 +
+ 2 files changed, 2 insertions(+)
---- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am
-+++ gcc-4.1.2/libstdc++-v3/po/Makefile.am
-@@ -39,6 +39,7 @@ MSGFMT = msgfmt
+diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
+index a9391d8d167..f7eee24dc8c 100644
+--- a/libstdc++-v3/po/Makefile.am
++++ b/libstdc++-v3/po/Makefile.am
+@@ -38,6 +38,7 @@ MSGFMT = msgfmt
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN)
.po.mo:
@@ -27,9 +37,11 @@ https://bugs.gentoo.org/295480
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
---- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in
-+++ gcc-4.1.2/libstdc++-v3/po/Makefile.in
-@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am
+diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
+index a0f84b0cfa0..ab24a47a2fd 100644
+--- a/libstdc++-v3/po/Makefile.in
++++ b/libstdc++-v3/po/Makefile.in
+@@ -548,6 +548,7 @@ uninstall-am:
.po.mo:
@@ -37,3 +49,6 @@ https://bugs.gentoo.org/295480
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
+--
+2.27.0
+
diff --git a/main/gcc/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/main/gcc/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
new file mode 100644
index 0000000000..2383cb0982
--- /dev/null
+++ b/main/gcc/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
@@ -0,0 +1,28 @@
+From 2ec258d6d31e2c0c614c5086acee84a87768a67c Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:52:07 +0000
+Subject: [PATCH 10/28] Don't declare asprintf if defined as a macro.
+
+---
+ include/libiberty.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/libiberty.h b/include/libiberty.h
+index 141cb886a85..fa0e78eb62f 100644
+--- a/include/libiberty.h
++++ b/include/libiberty.h
+@@ -645,8 +645,11 @@ extern int pwait (int, int *, int);
+ /* Like sprintf but provides a pointer to malloc'd storage, which must
+ be freed by the caller. */
+
++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
++#ifndef asprintf
+ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
+ #endif
++#endif
+
+ /* Like asprintf but allocates memory without fail. This works like
+ xmalloc. */
+--
+2.27.0
+
diff --git a/main/gcc/0010-ldbl128-config.patch b/main/gcc/0010-ldbl128-config.patch
deleted file mode 100644
index b5a1010528..0000000000
--- a/main/gcc/0010-ldbl128-config.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001
-From: Szabolcs Nagy <nsz@port70.net>
-Date: Wed, 28 Feb 2018 00:54:05 +0000
-Subject: [PATCH 10/12] ldbl128 config
-
----
- gcc/configure | 13 +++++++++++++
- gcc/configure.ac | 16 ++++++++++++++--
- 2 files changed, 27 insertions(+), 2 deletions(-)
-
-diff --git a/gcc/configure b/gcc/configure
-index 6121e163259..07ff8597d48 100755
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -29309,6 +29309,15 @@ if test "${with_long_double_128+set}" = set; then :
- withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128"
- else
-
-+ case "$target" in
-+ s390*-*-linux-musl*)
-+ gcc_cv_target_ldbl128=yes
-+ ;;
-+ powerpc*-*-linux-musl*)
-+ gcc_cv_target_ldbl128=no
-+ ;;
-+ *)
-+
- if test $glibc_version_major -gt 2 \
- || ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 4 ); then :
- gcc_cv_target_ldbl128=yes
-@@ -29320,6 +29329,10 @@ else
- && gcc_cv_target_ldbl128=yes
-
- fi
-+
-+ ;;
-+ esac
-+
- fi
-
- ;;
-diff --git a/gcc/configure.ac b/gcc/configure.ac
-index b066cc609e1..6c15ed898c0 100644
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -5971,13 +5971,25 @@ case "$target" in
- AC_ARG_WITH(long-double-128,
- [AS_HELP_STRING([--with-long-double-128],
- [use 128-bit long double by default])],
-- gcc_cv_target_ldbl128="$with_long_double_128",
-+ gcc_cv_target_ldbl128="$with_long_double_128", [
-+ case "$target" in
-+ s390*-*-linux-musl*)
-+ gcc_cv_target_ldbl128=yes
-+ ;;
-+ powerpc*-*-linux-musl*)
-+ gcc_cv_target_ldbl128=no
-+ ;;
-+ *)]
- [GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [
- [gcc_cv_target_ldbl128=no
- grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \
- $target_header_dir/bits/wordsize.h > /dev/null 2>&1 \
- && gcc_cv_target_ldbl128=yes
-- ]])])
-+ ]])]
-+ [
-+ ;;
-+ esac
-+ ])
- ;;
- esac
- if test x$gcc_cv_target_ldbl128 = xyes; then
---
-2.17.1
-
diff --git a/main/gcc/0011-libiberty-copy-PIC-objects-during-build-process.patch b/main/gcc/0011-libiberty-copy-PIC-objects-during-build-process.patch
new file mode 100644
index 0000000000..20ef785a75
--- /dev/null
+++ b/main/gcc/0011-libiberty-copy-PIC-objects-during-build-process.patch
@@ -0,0 +1,24 @@
+From 4f6fd2272f57620da399d0f841fce12b9db3b2d1 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:53:00 +0000
+Subject: [PATCH 11/28] libiberty: copy PIC objects during build process
+
+---
+ libiberty/Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index d6b302e02fd..fd39928546f 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -263,6 +263,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
+--
+2.27.0
+
diff --git a/main/gcc/053_all_libitm-no-fortify-source.patch b/main/gcc/0012-libitm-disable-FORTIFY.patch
index 5ab15afc37..2d58db7746 100644
--- a/main/gcc/053_all_libitm-no-fortify-source.patch
+++ b/main/gcc/0012-libitm-disable-FORTIFY.patch
@@ -1,14 +1,17 @@
-https://bugs.gentoo.org/508852
-https://gcc.gnu.org/PR61164
+From cef5e0336cfdf4afd0e01fa9e562f686b234697a Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:53:36 +0000
+Subject: [PATCH 12/28] libitm: disable FORTIFY
-2014-04-27 Magnus Granberg <zorry@gentoo.org>
-
- #508852
- * libitm/configure.tgt: Disable FORTIFY
+---
+ libitm/configure.tgt | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+diff --git a/libitm/configure.tgt b/libitm/configure.tgt
+index 04109160e91..107b957ece3 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
-@@ -43,6 +43,16 @@ if test "$gcc_cv_have_tls" = yes ; then
+@@ -46,6 +46,16 @@ if test "$gcc_cv_have_tls" = yes ; then
esac
fi
@@ -25,3 +28,6 @@ https://gcc.gnu.org/PR61164
# 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.27.0
+
diff --git a/main/gcc/0012-static-pie.patch b/main/gcc/0012-static-pie.patch
deleted file mode 100644
index d7cfcb7815..0000000000
--- a/main/gcc/0012-static-pie.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From a4aa319f7c19e564dced3daeb7222c9315af936c Mon Sep 17 00:00:00 2001
-From: Szabolcs Nagy <nsz@port70.net>
-Date: Sat, 18 Aug 2018 23:58:45 +0000
-Subject: [PATCH 12/12] static-pie
-
-in gcc-8 -static means static non-pie, even if -pie or -static-pie
-are specified, -static-pie can be used to build static pie.
-
-in musl toolchains -static -pie always meant static pie, so this
-patch fixes the link specs accordingly, the new -static-pie is just
-an alias to -static -pie.
----
- gcc/common.opt | 4 ++--
- gcc/config/gnu-user.h | 12 +++++-------
- gcc/config/rs6000/sysv4.h | 11 +++++------
- gcc/gcc.c | 6 +++---
- 4 files changed, 15 insertions(+), 18 deletions(-)
-
-diff --git a/gcc/common.opt b/gcc/common.opt
-index b52ef0b38c8..0ce5857e01d 100644
---- a/gcc/common.opt
-+++ b/gcc/common.opt
-@@ -3197,11 +3197,11 @@ Driver
-
- no-pie
- Driver RejectNegative Negative(shared)
--Don't create a dynamically linked position independent executable.
-+Don't create a position independent executable.
-
- pie
- Driver RejectNegative Negative(no-pie)
--Create a dynamically linked position independent executable.
-+Create a position independent executable.
-
- static-pie
- Driver RejectNegative Negative(pie)
-diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
-index 8620de3e42d..235328a2642 100644
---- a/gcc/config/gnu-user.h
-+++ b/gcc/config/gnu-user.h
-@@ -51,13 +51,12 @@
- #define GNU_USER_TARGET_STARTFILE_SPEC \
- "%{shared:; \
- pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
-- static:crt1.o%s; \
-- static-pie:rcrt1.o%s; \
-+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \
- " PIE_SPEC ":Scrt1.o%s; \
- :crt1.o%s} " \
- GNU_USER_TARGET_CRTI " \
-- %{static:crtbeginT.o%s; \
-- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
-+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \
-+ static:crtbeginT.o%s; \
- :crtbegin.o%s} \
- %{fvtable-verify=none:%s; \
- fvtable-verify=preinit:vtv_start_preinit.o%s; \
-@@ -76,8 +75,7 @@
- "%{fvtable-verify=none:%s; \
- fvtable-verify=preinit:vtv_end_preinit.o%s; \
- fvtable-verify=std:vtv_end.o%s} \
-- %{static:crtend.o%s; \
-- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
-+ %{shared|" PIE_SPEC ":crtendS.o%s; \
- :crtend.o%s} " \
- GNU_USER_TARGET_CRTN " " \
- CRTOFFLOADEND
-@@ -133,7 +131,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
- #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
-
- #if defined(HAVE_LD_EH_FRAME_HDR)
--#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
-+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} "
- #endif
-
- #undef LINK_GCC_C_SEQUENCE_SPEC
-diff --git a/gcc/gcc.c b/gcc/gcc.c
-index eb1610ba8b0..87560afb03c 100644
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -900,7 +900,7 @@ proper position among the other output files. */
- #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC
- #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;"
- #else
--#define PIE_SPEC "pie"
-+#define PIE_SPEC "pie|static-pie"
- #define FPIE1_SPEC "fpie"
- #define NO_FPIE1_SPEC FPIE1_SPEC ":;"
- #define FPIE2_SPEC "fPIE"
-@@ -924,12 +924,12 @@ proper position among the other output files. */
- #ifndef LINK_PIE_SPEC
- #ifdef HAVE_LD_PIE
- #ifndef LD_PIE_SPEC
--#define LD_PIE_SPEC "-pie"
-+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}"
- #endif
- #else
- #define LD_PIE_SPEC ""
- #endif
--#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
-+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
- #endif
-
- #ifndef LINK_BUILDID_SPEC
---
-2.17.1
-
diff --git a/main/gcc/203-libgcc_s.patch b/main/gcc/0013-libgcc_s.patch
index f8cab7d194..74d82ea011 100644
--- a/main/gcc/203-libgcc_s.patch
+++ b/main/gcc/0013-libgcc_s.patch
@@ -1,19 +1,19 @@
-From 9e3eab51e518018d9d99b3123598b1e2322a6af3 Mon Sep 17 00:00:00 2001
+From d31721459e363e49dfe0a7797300864d9cef92f0 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
-Subject: [PATCH 3/6] libgcc_s
+Subject: [PATCH 13/28] libgcc_s
---
- gcc/config/i386/i386.c | 4 ++--
- libgcc/config/i386/cpuinfo.c | 6 +++---
- libgcc/config/i386/t-linux | 2 +-
+ gcc/config/i386/i386-expand.c | 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.c b/gcc/config/i386/i386.c
-index 3d044e8..82523e1 100644
---- a/gcc/config/i386/i386.c
-+++ b/gcc/config/i386/i386.c
-@@ -40269,10 +40269,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
+diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
+index 6c759b01edf..8cf0e069e1c 100644
+--- a/gcc/config/i386/i386-expand.c
++++ b/gcc/config/i386/i386-expand.c
+@@ -10948,10 +10948,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@@ -27,10 +27,10 @@ index 3d044e8..82523e1 100644
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
}
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
-index 8c2248d..6c82f15 100644
+index cf5f0884bb4..ed0381e7744 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
-@@ -485,7 +485,7 @@ __cpu_indicator_init (void)
+@@ -510,7 +510,7 @@ __cpu_indicator_init (void)
return 0;
}
@@ -42,7 +42,7 @@ index 8c2248d..6c82f15 100644
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
#endif
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
-index 11bb46e..4f47f7b 100644
+index 8506a635790..564296f788e 100644
--- a/libgcc/config/i386/t-linux
+++ b/libgcc/config/i386/t-linux
@@ -3,5 +3,5 @@
@@ -53,5 +53,5 @@ index 11bb46e..4f47f7b 100644
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
-2.8.1
+2.27.0
diff --git a/main/gcc/205-nopie.patch b/main/gcc/0014-nopie.patch
index e3da94d105..9cc97c07d2 100644
--- a/main/gcc/205-nopie.patch
+++ b/main/gcc/0014-nopie.patch
@@ -1,7 +1,7 @@
-From b6015aca9c9cc83739fd0ed637a835119b2c4e34 Mon Sep 17 00:00:00 2001
+From f64f853eae3b390adbbc9b74a336d93918e6dca4 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
-Subject: [PATCH 5/6] nopie
+Subject: [PATCH 14/28] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
@@ -9,10 +9,10 @@ Subject: [PATCH 5/6] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
-index 1c6e340..7e8b5d6 100755
+index 90e3be864f8..951a093b459 100755
--- a/gcc/configure
+++ b/gcc/configure
-@@ -29390,6 +29390,33 @@ fi
+@@ -30774,6 +30774,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 1c6e340..7e8b5d6 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
-index 6c1dcd9..0ca7647 100644
+index f42006e5476..fe392298016 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -6098,6 +6098,19 @@ AC_CACHE_CHECK([for -no-pie option],
+@@ -6858,6 +6858,19 @@ AC_CACHE_CHECK([for -no-pie option],
LDFLAGS="$saved_LDFLAGS"])
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@@ -71,5 +71,5 @@ index 6c1dcd9..0ca7647 100644
AC_SUBST([NO_PIE_FLAG])
--
-2.8.1
+2.27.0
diff --git a/main/gcc/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch b/main/gcc/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
new file mode 100644
index 0000000000..bf7b0779d2
--- /dev/null
+++ b/main/gcc/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
@@ -0,0 +1,25 @@
+From 37dace030c1402a8e6734a0fc59e18717ce1a2ef Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:57:09 +0000
+Subject: [PATCH 15/28] 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.27.0
+
diff --git a/main/gcc/404-dlang-zlib.patch b/main/gcc/0016-dlang-update-zlib-binding.patch
index 4c453258dc..b04ee92fd8 100644
--- a/main/gcc/404-dlang-zlib.patch
+++ b/main/gcc/0016-dlang-update-zlib-binding.patch
@@ -1,6 +1,16 @@
-diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
---- a/libphobos/src/std/zlib.d 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/src/std/zlib.d 2020-01-01 00:00:00.000000000 +0900
+From 7fc386a2e629e859968da4eb4d0ff4983cb3b76f Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:57:51 +0000
+Subject: [PATCH 16/28] 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.
@@ -62,7 +72,7 @@ diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
*
* See_Also:
* $(LINK http://en.wikipedia.org/wiki/Adler-32)
-@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] b
+@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] buf)
* buf = buffer containing input data
*
* Returns:
@@ -89,7 +99,7 @@ diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
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,
+@@ -276,7 +282,7 @@ void[] uncompress(const(void)[] srcbuf, size_t destlen = 0u, int winbits = 15)
throw new ZlibException(err);
}
}
@@ -172,7 +182,7 @@ diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
if (!inited)
{
@@ -598,26 +607,152 @@ class UnCompress
-
+
if (!destbufsize)
destbufsize = to!uint(buf.length) * 2;
- destbuf = new ubyte[zs.avail_in * 2 + destbufsize];
@@ -334,7 +344,7 @@ diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
/**
* Decompress and return any remaining data.
* The returned data should be appended to that returned by uncompress().
-@@ -626,48 +761,39 @@ class UnCompress
+@@ -626,49 +761,40 @@ class UnCompress
void[] flush()
in
{
@@ -409,3 +419,7 @@ diff -Nurp a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d
+ assert(decompressor.empty, "The UnCompressor reports not being done");
}
}
+
+--
+2.27.0
+
diff --git a/main/gcc/0016-invalid_tls_model.patch b/main/gcc/0016-invalid_tls_model.patch
deleted file mode 100644
index c387f3eb00..0000000000
--- a/main/gcc/0016-invalid_tls_model.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fixes errors such as:
-
-GEGL-Message: 16:04:13.794: Module '/usr/lib/gegl-0.4/raw-load.so' load error: Error relocating /usr/lib/libgomp.so.1: __cxa_finalize: initial-exec TLS resolves to dynamic definition in /usr/lib/libgomp.so.1
-
---- a/libgomp/configure.tgt 2018-11-08 18:13:04.000000000 +0100
-+++ b/libgomp/configure.tgt 2019-06-29 20:06:31.972950350 +0200
-@@ -10,23 +10,6 @@
- # XCFLAGS Add extra compile flags to use.
- # XLDFLAGS Add extra link flags to use.
-
--# Optimize TLS usage by avoiding the overhead of dynamic allocation.
--if test $gcc_cv_have_tls = yes ; then
-- case "${target}" in
--
-- *-*-k*bsd*-gnu*)
-- ;;
--
-- *-*-linux* | *-*-gnu*)
-- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS"
-- ;;
--
-- *-*-rtems*)
-- XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
-- ;;
-- esac
--fi
--
- # Since we require POSIX threads, assume a POSIX system by default.
- config_path="posix"
diff --git a/main/gcc/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch b/main/gcc/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
new file mode 100644
index 0000000000..d9733410dc
--- /dev/null
+++ b/main/gcc/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
@@ -0,0 +1,51 @@
+From ef5f7880cff27a2b92952ce53a207d5dd896923b Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:58:22 +0000
+Subject: [PATCH 17/28] dlang: fix fcntl on mips, add libucontext dep
+
+---
+ libphobos/configure.tgt | 1 +
+ libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
+index 94e42bf5509..73f2e4b7f01 100644
+--- a/libphobos/configure.tgt
++++ b/libphobos/configure.tgt
+@@ -35,6 +35,7 @@ case "${target}" in
+ ;;
+ mips*-*-linux*)
+ LIBPHOBOS_SUPPORTED=yes
++ LIBDRUNTIME_NEEDS_UCONTEXT=yes
+ ;;
+ power*-*-linux*)
+ LIBPHOBOS_SUPPORTED=yes
+diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
+index 9febcff849b..cb34e2108bd 100644
+--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
++++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
+@@ -870,6 +870,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.27.0
+
diff --git a/main/gcc/ada-shared.patch b/main/gcc/0018-ada-fix-shared-linking.patch
index 6f1c16aff9..6ffbcb9734 100644
--- a/main/gcc/ada-shared.patch
+++ b/main/gcc/0018-ada-fix-shared-linking.patch
@@ -1,10 +1,19 @@
-Index: b/gcc/ada/link.c
-===================================================================
+From b675e0383262d6d702f5b732e4459d3e2c2a4891 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:59:16 +0000
+Subject: [PATCH 18/28] ada: fix shared linking
+
+---
+ gcc/ada/link.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gcc/ada/link.c b/gcc/ada/link.c
+index 02c413a412f..f0e52a87d6e 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
-@@ -105,9 +105,9 @@
-
- #elif defined (__FreeBSD__)
+@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
+ || defined (__NetBSD__) || defined (__OpenBSD__) \
+ || defined (__QNX__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
@@ -15,9 +24,9 @@ Index: b/gcc/ada/link.c
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
-@@ -127,9 +127,9 @@
+@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
- #elif defined (linux) || defined(__GLIBC__)
+ #elif defined (__linux__) || defined (__GLIBC__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
@@ -28,3 +37,6 @@ Index: b/gcc/ada/link.c
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
+--
+2.27.0
+
diff --git a/main/gcc/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/main/gcc/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
new file mode 100644
index 0000000000..e231809b73
--- /dev/null
+++ b/main/gcc/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
@@ -0,0 +1,24 @@
+From 0ea91dd6f8d856d5b589c2a3e95469fea06e7094 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 06:59:43 +0000
+Subject: [PATCH 19/28] build: fix CXXFLAGS_FOR_BUILD passing
+
+---
+ Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 36e369df6e7..63627db68cf 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -170,6 +170,7 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+--
+2.27.0
+
diff --git a/main/gcc/0020-libstdc-futex-add-time64-compatibility.patch b/main/gcc/0020-libstdc-futex-add-time64-compatibility.patch
new file mode 100644
index 0000000000..3aab207fbf
--- /dev/null
+++ b/main/gcc/0020-libstdc-futex-add-time64-compatibility.patch
@@ -0,0 +1,32 @@
+From 9684a815e1cbe854383c3c511e1d84d43c46ec94 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:00:17 +0000
+Subject: [PATCH 20/28] libstdc++: futex: add time64 compatibility
+
+---
+ libstdc++-v3/src/c++11/futex.cc | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc
+index c9de11a7ec7..7be702dbeda 100644
+--- a/libstdc++-v3/src/c++11/futex.cc
++++ b/libstdc++-v3/src/c++11/futex.cc
+@@ -61,7 +61,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+ // Convert the absolute timeout value to a relative timeout
++#if defined(SYS_futex_time64)
++ struct
++ {
++ long tv_sec;
++ long tv_nsec;
++ } rt;
++#else
+ struct timespec rt;
++#endif
+ rt.tv_sec = __s.count() - tv.tv_sec;
+ rt.tv_nsec = __ns.count() - tv.tv_usec * 1000;
+ if (rt.tv_nsec < 0)
+--
+2.27.0
+
diff --git a/main/gcc/0021-add-fortify-headers-paths.patch b/main/gcc/0021-add-fortify-headers-paths.patch
new file mode 100644
index 0000000000..155650fed2
--- /dev/null
+++ b/main/gcc/0021-add-fortify-headers-paths.patch
@@ -0,0 +1,25 @@
+From a0708ec975c01b049d254dc51179898966bf8a52 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:01:06 +0000
+Subject: [PATCH 21/28] add fortify-headers paths
+
+---
+ gcc/config/linux.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 95654bcdb5a..d88df8f154a 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
+
+ #ifdef NATIVE_SYSTEM_HEADER_DIR
+ #define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
+ #else
+--
+2.27.0
+
diff --git a/main/gcc/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/main/gcc/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
new file mode 100644
index 0000000000..c1d1befe64
--- /dev/null
+++ b/main/gcc/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
@@ -0,0 +1,31 @@
+From 740342a0e4b0b3af498964440918abba1a27ba33 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 22/28] Alpine musl package provides libssp_nonshared.a. We
+ link to it unconditionally, as otherwise we get link failures if some objects
+ are -fstack-protector built and final link happens with -fno-stack-protector.
+ This seems to be the common case when bootstrapping gcc, the piepatches do
+ not seem to fully fix the crosstoolchain and bootstrap sequence wrt.
+ stack-protector flag usage.
+
+---
+ gcc/gcc.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index daeb4d0c8ea..6920bec0fa0 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -894,8 +894,7 @@ proper position among the other output files. */
+
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+- "|fstack-protector-strong|fstack-protector-explicit:}"
++#define LINK_SSP_SPEC "-lssp_nonshared"
+ #else
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+ "|fstack-protector-strong|fstack-protector-explicit" \
+--
+2.27.0
+
diff --git a/main/gcc/gcc-as-needed-gold.patch b/main/gcc/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
index e22e59bce0..341f9936af 100644
--- a/main/gcc/gcc-as-needed-gold.patch
+++ b/main/gcc/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
@@ -1,10 +1,18 @@
-# DP: Use --push-state/--pop-state for gold as well when linking libtsan.
+From 775adf35d6f34f61947fc28a2bdbfa7e881c40d5 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:03:42 +0000
+Subject: [PATCH 23/28] DP: Use --push-state/--pop-state for gold as well when
+ linking libtsan.
-Index: b/gcc/gcc.c
-===================================================================
+---
+ gcc/gcc.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 6920bec0fa0..40e07354b3d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
-@@ -693,10 +693,10 @@ proper position among the other output f
+@@ -696,10 +696,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 "}" \
@@ -17,7 +25,7 @@ Index: b/gcc/gcc.c
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
-@@ -714,10 +714,10 @@ proper position among the other output f
+@@ -717,10 +717,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 "}" \
@@ -30,7 +38,7 @@ Index: b/gcc/gcc.c
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
-@@ -735,10 +735,10 @@ proper position among the other output f
+@@ -738,10 +738,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 "}" \
@@ -43,7 +51,7 @@ Index: b/gcc/gcc.c
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
-@@ -754,10 +754,10 @@ proper position among the other output f
+@@ -757,10 +757,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 "}" \
@@ -56,3 +64,6 @@ Index: b/gcc/gcc.c
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
+--
+2.27.0
+
diff --git a/main/gcc/gcc-pure64-mips.patch b/main/gcc/0024-Pure-64-bit-MIPS.patch
index d78f283810..6ecc752f27 100644
--- a/main/gcc/gcc-pure64-mips.patch
+++ b/main/gcc/0024-Pure-64-bit-MIPS.patch
@@ -1,7 +1,7 @@
-From b8c4e45d052adc247341066f748421743704b481 Mon Sep 17 00:00:00 2001
+From 717090cf538f765db1730956c512a43f2d52a802 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] Pure 64-bit MIPS
+Subject: [PATCH 24/28] Pure 64-bit MIPS
---
gcc/config/mips/mips.h | 8 ++++----
@@ -9,10 +9,10 @@ Subject: [PATCH] Pure 64-bit MIPS
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
-index 803ab98e7..afd74752f 100644
+index 3ce0c19a29a..b9920b49167 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
-@@ -3330,11 +3330,11 @@ struct GTY(()) machine_function {
+@@ -3424,11 +3424,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
@@ -29,7 +29,7 @@ index 803ab98e7..afd74752f 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 16c8adf85..bb46204db 100644
+index ceb58d3b5f3..8116e23ebba 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
@@ -43,5 +43,5 @@ index 16c8adf85..bb46204db 100644
+ ../lib32 \
+ ../lib
--
-2.15.1
+2.27.0
diff --git a/main/gcc/gcc-pure64.patch b/main/gcc/0025-use-pure-64-bit-configuration-where-appropriate.patch
index 2c350fe5ad..c9e158866a 100644
--- a/main/gcc/gcc-pure64.patch
+++ b/main/gcc/0025-use-pure-64-bit-configuration-where-appropriate.patch
@@ -1,17 +1,23 @@
---- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000
-+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000
-@@ -34,6 +34,6 @@
- comma=,
- MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
- MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
--MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
--MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
-+MULTILIB_OSDIRNAMES = m64=../lib
-+MULTILIB_OSDIRNAMES+= m32=../lib32
- MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
---- ./gcc/config/aarch64/t-aarch64-linux.orig
-+++ ./gcc/config/aarch64/t-aarch64-linux
-@@ -22,7 +22,7 @@
+From f73cf8d2f8f4eee71fc2ba850672e69f509a4486 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:04:40 +0000
+Subject: [PATCH 25/28] use pure 64-bit configuration where appropriate
+
+---
+ gcc/config/aarch64/t-aarch64-linux | 2 +-
+ gcc/config/i386/t-linux64 | 4 ++--
+ gcc/config/rs6000/t-linux | 6 ++++--
+ gcc/config/rs6000/t-linux64 | 4 ++--
+ gcc/config/rs6000/t-linux64bele | 4 ++--
+ gcc/config/rs6000/t-linux64lebe | 4 ++--
+ gcc/config/s390/t-linux64 | 4 ++--
+ 7 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
+index 83e59e33b85..6ec56fdf6a8 100644
+--- a/gcc/config/aarch64/t-aarch64-linux
++++ b/gcc/config/aarch64/t-aarch64-linux
+@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
LIB1ASMFUNCS = _aarch64_sync_cache_range
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
@@ -19,19 +25,24 @@
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
- MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
---- ./gcc/config/s390/t-linux64.orig
-+++ ./gcc/config/s390/t-linux64
-@@ -7,5 +7,5 @@
- MULTILIB_OPTIONS = m64/m31
- MULTILIB_DIRNAMES = 64 32
--MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
--MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+ MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
+diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
+index 1171e218578..256f8c079ba 100644
+--- a/gcc/config/i386/t-linux64
++++ b/gcc/config/i386/t-linux64
+@@ -33,6 +33,6 @@
+ comma=,
+ MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+ MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
-
---- ./gcc/config/rs6000/t-linux.orig
-+++ ./gcc/config/rs6000/t-linux
+ MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
+diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
+index aeb7440c492..ab14c455d8d 100644
+--- a/gcc/config/rs6000/t-linux
++++ b/gcc/config/rs6000/t-linux
@@ -2,7 +2,8 @@
# or soft-float.
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
@@ -40,9 +51,9 @@
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
else
- ifneq (,$(findstring spe,$(target)))
- MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1)
-@@ -14,7 +15,8 @@
+ MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
+ endif
+@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target)))
MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME))
endif
ifneq (,$(findstring powerpc64le,$(target)))
@@ -52,8 +63,10 @@
endif
endif
---- ./gcc/config/rs6000/t-linux64.orig
-+++ ./gcc/config/rs6000/t-linux64
+diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
+index 264a7e27524..d1e460811cc 100644
+--- a/gcc/config/rs6000/t-linux64
++++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
MULTILIB_OPTIONS := m64/m32
MULTILIB_DIRNAMES := 64 32
@@ -65,8 +78,10 @@
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
$(COMPILE) $<
---- ./gcc/config/rs6000/t-linux64bele.orig
-+++ ./gcc/config/rs6000/t-linux64bele
+diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele
+index 97c1ee6fb4d..08d72639cb6 100644
+--- a/gcc/config/rs6000/t-linux64bele
++++ b/gcc/config/rs6000/t-linux64bele
@@ -2,6 +2,6 @@
MULTILIB_OPTIONS += mlittle
@@ -76,8 +91,10 @@
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
---- ./gcc/config/rs6000/t-linux64lebe.orig
-+++ ./gcc/config/rs6000/t-linux64lebe
+diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe
+index 2e63bdb9fc9..c6e1c5db65d 100644
+--- a/gcc/config/rs6000/t-linux64lebe
++++ b/gcc/config/rs6000/t-linux64lebe
@@ -2,6 +2,6 @@
MULTILIB_OPTIONS += mbig
@@ -87,3 +104,18 @@
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
+diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64
+index cc6ab367072..7f498ee1cdc 100644
+--- a/gcc/config/s390/t-linux64
++++ b/gcc/config/s390/t-linux64
+@@ -7,5 +7,5 @@
+
+ MULTILIB_OPTIONS = m64/m31
+ MULTILIB_DIRNAMES = 64 32
+-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
+-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.27.0
+
diff --git a/main/gcc/libgcc-always-build-gcceh.a.patch b/main/gcc/0026-always-build-libgcc_eh.a.patch
index 74ae897304..04b5d16b39 100644
--- a/main/gcc/libgcc-always-build-gcceh.a.patch
+++ b/main/gcc/0026-always-build-libgcc_eh.a.patch
@@ -1,11 +1,20 @@
-Highly inspired by:
+From 8472f6d0037dcd19c44b1e95d95fbf937b3823e6 Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:05:41 +0000
+Subject: [PATCH 26/28] always build libgcc_eh.a
+
+highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
+---
+ libgcc/Makefile.in | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
-diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
---- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
-+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
-@@ -772,8 +772,9 @@
- libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
+diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
+index 851e7657d07..99ec513a1a6 100644
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -956,8 +956,9 @@ ifneq ($(LIBUNWIND),)
+ all: libunwind.a
endif
+all: libgcc_eh.a
@@ -14,8 +23,8 @@ diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
+all: libgcc_s$(SHLIB_EXT)
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
- endif
-@@ -950,10 +951,6 @@
+ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
+@@ -1159,10 +1160,6 @@ install-libunwind:
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
@@ -26,9 +35,9 @@ diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
-@@ -968,6 +965,10 @@
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
+@@ -1179,6 +1176,10 @@ ifeq ($(enable_gcov),yes)
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
+ endif
+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
@@ -37,3 +46,6 @@ diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
+--
+2.27.0
+
diff --git a/main/gcc/libgnarl-musl.patch b/main/gcc/0027-ada-libgnarl-compatibility-for-musl.patch
index 7e35cda682..8ec5d2d257 100644
--- a/main/gcc/libgnarl-musl.patch
+++ b/main/gcc/0027-ada-libgnarl-compatibility-for-musl.patch
@@ -1,7 +1,18 @@
-diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads
---- gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800
-+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+From 4e1b3a26f558e7693853d3600ee677705e67406c Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:06:30 +0000
+Subject: [PATCH 27/28] ada: libgnarl compatibility for musl
+
+---
+ gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
+ gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++--------------------------
+ 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 80cb2b2a793..701b7a3aeab 100644
+--- a/gcc/ada/libgnarl/s-osinte__linux.ads
++++ b/gcc/ada/libgnarl/s-osinte__linux.ads
+@@ -399,12 +399,6 @@ package System.OS_Interface is
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
@@ -14,7 +25,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
function pthread_rwlock_init
(mutex : access pthread_rwlock_t;
attr : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -466,11 +460,6 @@ package System.OS_Interface is
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
@@ -26,10 +37,11 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/l
type struct_sched_param is record
sched_priority : int; -- scheduling priority
end record;
-diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb
---- gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800
-+++ gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper
+diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
+index c45559e5ba0..0b0f173e7d4 100644
+--- a/gcc/ada/libgnarl/s-taprop__linux.adb
++++ b/gcc/ada/libgnarl/s-taprop__linux.adb
+@@ -202,9 +202,6 @@ package body System.Task_Primitives.Operations is
pragma Import
(C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
@@ -39,7 +51,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
-- We do not have pragma Linker_Options ("-lcap"); here, because this
-- library is not present on many Linux systems. 'libcap' is the Linux
-- "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper
+@@ -214,38 +211,6 @@ package body System.Task_Primitives.Operations is
-- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
-- GNU/Linux, so we map 0 .. 98 to 1 .. 99.
@@ -78,7 +90,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
-- True if the locking policy is Ceiling_Locking, and the current process
-- has permission to use this policy. The process has permission if it is
-- running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper
+@@ -348,7 +313,9 @@ package body System.Task_Primitives.Operations is
-- Init_Mutex --
----------------
@@ -88,7 +100,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
Mutex_Attr : aliased pthread_mutexattr_t;
Result, Result_2 : C.int;
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper
+@@ -360,16 +327,7 @@ package body System.Task_Primitives.Operations is
return Result;
end if;
@@ -106,7 +118,7 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
Result := pthread_mutexattr_setprotocol
(Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper
+@@ -409,11 +367,6 @@ package body System.Task_Primitives.Operations is
Result := pthread_rwlockattr_init (RWlock_Attr'Access);
pragma Assert (Result = 0);
@@ -118,3 +130,6 @@ diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/l
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
+--
+2.27.0
+
diff --git a/main/gcc/ada-musl.patch b/main/gcc/0028-ada-musl-support-fixes.patch
index 1487f4a57d..000bc6b94f 100644
--- a/main/gcc/ada-musl.patch
+++ b/main/gcc/0028-ada-musl-support-fixes.patch
@@ -1,8 +1,69 @@
+From 5e3d7d2f1e2448b6c5eb207f9251c437629e43bc Mon Sep 17 00:00:00 2001
+From: Ariadne Conill <ariadne@dereferenced.org>
+Date: Fri, 21 Aug 2020 07:07:48 +0000
+Subject: [PATCH 28/28] ada: musl support fixes
+
+---
+ gcc/ada/Makefile.rtl | 10 +++++-----
+ gcc/ada/adaint.c | 34 +++++++++++++++++++---------------
+ gcc/ada/adaint.h | 10 ++++------
+ gcc/ada/terminals.c | 8 ++++----
+ 4 files changed, 32 insertions(+), 30 deletions(-)
+
+diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
+index 55ff9b0f3d5..0fadf4e4b79 100644
+--- a/gcc/ada/Makefile.rtl
++++ b/gcc/ada/Makefile.rtl
+@@ -1533,7 +1533,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) \
+- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++ s-tsmona.adb<libgnat/s-tsmona.adb \
+ a-exetim.adb<libgnarl/a-exetim__posix.adb \
+ a-exetim.ads<libgnarl/a-exetim__default.ads \
+ s-linux.ads<libgnarl/s-linux.ads \
+@@ -2083,7 +2083,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+ s-osinte.adb<libgnarl/s-osinte__posix.adb \
+ s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
+ $(TRASYM_DWARF_UNIX_PAIRS) \
+- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++ s-tsmona.adb<libgnat/s-tsmona.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+ system.ads<libgnat/system-linux-ppc.ads
+@@ -2112,7 +2112,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+ endif
+
+ # ARM linux, GNU eabi
+-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<libgnarl/a-intnam__linux.ads \
+ s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
+@@ -2305,7 +2305,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) \
+- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++ s-tsmona.adb<libgnat/s-tsmona.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(ATOMICS_BUILTINS_TARGET_PAIRS) \
+ system.ads<libgnat/system-linux-ia64.ads
+@@ -2401,7 +2401,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) \
+- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
++ s-tsmona.adb<libgnat/s-tsmona.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(X86_64_TARGET_PAIRS) \
+ system.ads<libgnat/system-linux-x86.ads
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
-index 3b0aea9..ee0bb69 100644
+index 595abf87d65..00858c24f53 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
-@@ -76,6 +76,11 @@
+@@ -90,6 +90,11 @@
#include <sys/param.h>
#include <sys/pstat.h>
#endif
@@ -14,7 +75,7 @@ index 3b0aea9..ee0bb69 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
-@@ -3255,7 +3260,6 @@ __gnat_lwp_self (void)
+@@ -3308,7 +3313,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@@ -22,7 +83,7 @@ index 3b0aea9..ee0bb69 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
-@@ -3265,7 +3269,7 @@ __gnat_lwp_self (void)
+@@ -3318,7 +3322,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@@ -31,7 +92,7 @@ index 3b0aea9..ee0bb69 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
-@@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count)
+@@ -3331,33 +3335,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@@ -73,7 +134,7 @@ index 3b0aea9..ee0bb69 100644
}
size_t
-@@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
+@@ -3367,23 +3371,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@@ -103,7 +164,7 @@ index 3b0aea9..ee0bb69 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
-index 0d12f7e..a063b47 100644
+index 311e240dfcc..1c4d0050103 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void);
@@ -124,56 +185,11 @@ index 0d12f7e..a063b47 100644
#endif
#if defined (_WIN32)
---- a/gcc/ada/Makefile.rtl 2019-05-14 21:18:45.217455681 +0200
-+++ b/gcc/ada/Makefile.rtl 2019-05-14 21:21:30.686464218 +0200
-@@ -1521,7 +1521,7 @@
- s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
- $(TRASYM_DWARF_UNIX_PAIRS) \
- g-sercom.adb<libgnat/g-sercom__linux.adb \
-- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+ s-tsmona.adb<libgnat/s-tsmona.adb \
- a-exetim.adb<libgnarl/a-exetim__posix.adb \
- a-exetim.ads<libgnarl/a-exetim__default.ads \
- s-linux.ads<libgnarl/s-linux.ads \
-@@ -2073,7 +2073,7 @@
- s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
- g-sercom.adb<libgnat/g-sercom__linux.adb \
- $(TRASYM_DWARF_UNIX_PAIRS) \
-- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+ s-tsmona.adb<libgnat/s-tsmona.adb \
- $(ATOMICS_TARGET_PAIRS) \
- $(ATOMICS_BUILTINS_TARGET_PAIRS) \
- system.ads<libgnat/system-linux-ppc.ads
-@@ -2102,7 +2102,7 @@
- endif
-
- # ARM linux, GNU eabi
--ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
-+ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<libgnarl/a-intnam__linux.ads \
- s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
-@@ -2297,7 +2297,7 @@
- s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
- g-sercom.adb<libgnat/g-sercom__linux.adb \
- $(TRASYM_DWARF_UNIX_PAIRS) \
-- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+ s-tsmona.adb<libgnat/s-tsmona.adb \
- $(ATOMICS_TARGET_PAIRS) \
- $(ATOMICS_BUILTINS_TARGET_PAIRS) \
- system.ads<libgnat/system-linux-ia64.ads
-@@ -2394,7 +2394,7 @@
- s-taspri.ads<libgnarl/s-taspri__posix.ads \
- g-sercom.adb<libgnat/g-sercom__linux.adb \
- $(TRASYM_DWARF_UNIX_PAIRS) \
-- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
-+ s-tsmona.adb<libgnat/s-tsmona.adb \
- $(ATOMICS_TARGET_PAIRS) \
- $(X86_64_TARGET_PAIRS) \
- system.ads<libgnat/system-linux-x86.ads
---- a/gcc/ada/terminals.c 2019-01-08 10:54:04.000000000 +0100
-+++ b/gcc/ada/terminals.c 2019-05-15 13:14:09.935742526 +0200
-@@ -1136,7 +1136,7 @@
+diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
+index af4417fab90..bab6bf3ca87 100644
+--- a/gcc/ada/terminals.c
++++ b/gcc/ada/terminals.c
+@@ -1145,7 +1145,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
/* POSIX does not specify how to open the master side of a terminal.Several
methods are available (system specific):
1- using a cloning device (USE_CLONE_DEVICE)
@@ -182,7 +198,7 @@ index 0d12f7e..a063b47 100644
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
-@@ -1150,7 +1150,7 @@
+@@ -1159,7 +1159,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
@@ -191,7 +207,7 @@ index 0d12f7e..a063b47 100644
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
-@@ -1199,8 +1199,8 @@
+@@ -1208,8 +1208,8 @@ allocate_pty_desc (pty_desc **desc) {
int master_fd = -1;
char *slave_name = NULL;
@@ -202,3 +218,6 @@ index 0d12f7e..a063b47 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
+--
+2.27.0
+
diff --git a/main/gcc/002_all_default-relro.patch b/main/gcc/002_all_default-relro.patch
deleted file mode 100644
index c461017dc6..0000000000
--- a/main/gcc/002_all_default-relro.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-# Turn on -Wl,-z,relro,-z,now by default.
-
----
- gcc/doc/invoke.texi | 3 +++
- gcc/gcc.c | 1 +
- 2 files changed, 4 insertions(+), 0 deletions(-)
-
-Index: b/gcc/doc/invoke.texi
-===================================================================
---- a/gcc/doc/invoke.texi
-+++ b/gcc/doc/invoke.texi
-@@ -11424,6 +11424,9 @@ For example, @option{-Wl,-Map,output.map
- linker. When using the GNU linker, you can also get the same effect with
- @option{-Wl,-Map=output.map}.
-
-+NOTE: In Alpine Linux, for LDFLAGS, the option
-+@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
-+
- @item -u @var{symbol}
- @opindex u
- Pretend the symbol @var{symbol} is undefined, to force linking of
-Index: b/gcc/gcc.c
-===================================================================
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -890,6 +890,7 @@ proper position among the other output f
- "%{flto|flto=*:%<fcompare-debug*} \
- %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
- "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
-+ "-z relro -z now " \
- "%X %{o*} %{e*} %{N} %{n} %{r}\
- %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
- %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
diff --git a/main/gcc/012_all_default-warn-trampolines.patch b/main/gcc/012_all_default-warn-trampolines.patch
deleted file mode 100644
index 7a644cb1e1..0000000000
--- a/main/gcc/012_all_default-warn-trampolines.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Enable -Wtrampolines by default.
-
---- a/gcc/common.opt
-+++ b/gcc/common.opt
-@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning
- Do not suppress warnings from system headers.
-
- Wtrampolines
--Common Var(warn_trampolines) Warning
-+Common Var(warn_trampolines) Init(1) Warning
- Warn whenever a trampoline is generated.
-
- Wtype-limits
diff --git a/main/gcc/013_all_default-ssp-fix.patch b/main/gcc/013_all_default-ssp-fix.patch
deleted file mode 100644
index d2deac760b..0000000000
--- a/main/gcc/013_all_default-ssp-fix.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
-Change the buffer size.
-
---- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200
-+++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100
-@@ -857,6 +857,12 @@ proper position among the other output f
- #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
- #endif
-
-+#ifdef ENABLE_DEFAULT_SSP
-+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
-+#else
-+#define NO_SSP_SPEC ""
-+#endif
-+
- #ifndef LINK_SSP_SPEC
- #ifdef TARGET_LIBC_PROVIDES_SSP
- #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
-@@ -1131,7 +1148,7 @@ static const char *cc1_options =
- %{-version:--version}\
- %{-help=*:--help=%*}\
- %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
-- %{fsyntax-only:-o %j} %{-param*}\
-+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
- %{coverage:-fprofile-arcs -ftest-coverage}\
- %{fprofile-arcs|fprofile-generate*|coverage:\
- %{!fprofile-update=singel:\
---- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200
-+++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200
-@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
- DEFPARAM (PARAM_SSP_BUFFER_SIZE,
- "ssp-buffer-size",
- "The lower bound for a buffer to be considered for stack smashing protection.",
-- 8, 1, 0)
-+ 4, 1, 0)
-
- DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING,
- "min-size-for-stack-sharing",
diff --git a/main/gcc/050_all_libiberty-asprintf.patch b/main/gcc/050_all_libiberty-asprintf.patch
deleted file mode 100644
index bee0c4c237..0000000000
--- a/main/gcc/050_all_libiberty-asprintf.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-2008-07-25 Magnus Granberg <zorry@ume.nu>
-
- * include/libiberty.h (asprintf): Don't declare if defined as a macro
-
---- a/include/libiberty.h
-+++ b/include/libiberty.h
-@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
- /* Like sprintf but provides a pointer to malloc'd storage, which must
- be freed by the caller. */
-
-+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
-+#ifndef asprintf
- extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
- #endif
-+#endif
-
- #if !HAVE_DECL_VASPRINTF
- /* Like vsprintf but provides a pointer to malloc'd storage, which
diff --git a/main/gcc/051_all_libiberty-pic.patch b/main/gcc/051_all_libiberty-pic.patch
deleted file mode 100644
index b6160a7307..0000000000
--- a/main/gcc/051_all_libiberty-pic.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/libiberty/Makefile.in
-+++ b/libiberty/Makefile.in
-@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
- $(AR) $(AR_FLAGS) $(TARGETLIB) \
- $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
- $(RANLIB) $(TARGETLIB); \
-+ cp $(TARGETLIB) ../ ; \
- cd ..; \
- else true; fi
-
diff --git a/main/gcc/090_all_pr55930-dependency-tracking.patch b/main/gcc/090_all_pr55930-dependency-tracking.patch
deleted file mode 100644
index a8743e08c4..0000000000
--- a/main/gcc/090_all_pr55930-dependency-tracking.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-libatomic build failure if configured with --disable-dependency-tracking
-load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
-
-https://bugs.gentoo.org/463463
-http://gcc.gnu.org/PR55930
-
---- a/libatomic/Makefile.in
-+++ b/libatomic/Makefile.in
-@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
- PAT_S = $(word 3,$(PAT_SPLIT))
- IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
- IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
--M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
-+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
-+@AMDEP_FALSE@M_DEPS =
- M_SIZE = -DN=$(PAT_N)
- M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
- M_FILE = $(PAT_BASE)_n.c
diff --git a/main/gcc/320-libffi-gnulinux.patch b/main/gcc/320-libffi-gnulinux.patch
deleted file mode 100644
index b3b4fc9317..0000000000
--- a/main/gcc/320-libffi-gnulinux.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/libffi/closures.c.orig b/libffi/closures.c
-index 721ff00..22a699c 100644
---- a/libffi/src/closures.c.orig
-+++ 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
diff --git a/main/gcc/400-dlang-phobos.patch b/main/gcc/400-dlang-phobos.patch
deleted file mode 100644
index 7e434e7858..0000000000
--- a/main/gcc/400-dlang-phobos.patch
+++ /dev/null
@@ -1,1216 +0,0 @@
-diff -Nurp a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d
---- a/libphobos/libdruntime/core/stdc/fenv.d 2019-10-28 06:37:30.000000000 +0900
-+++ b/libphobos/libdruntime/core/stdc/fenv.d 2019-10-28 08:08:09.000000000 +0900
-@@ -375,7 +375,44 @@ else version (Solaris)
- }
- else version (CRuntime_Musl)
- {
-- version (X86_64)
-+ version (AArch64)
-+ {
-+ struct fenv_t
-+ {
-+ uint __fpcr;
-+ uint __fpsr;
-+ }
-+ alias uint fexcept_t;
-+ }
-+ else version (ARM)
-+ {
-+ import core.stdc.config : c_ulong;
-+
-+ struct fenv_t
-+ {
-+ c_ulong __cw;
-+ }
-+ alias c_ulong fexcept_t;
-+ }
-+ else version (IBMZ_Any)
-+ {
-+ alias uint fenv_t;
-+ alias uint fexcept_t;
-+ }
-+ else version (MIPS_Any)
-+ {
-+ struct fenv_t
-+ {
-+ uint __cw;
-+ }
-+ alias ushort fexcept_t;
-+ }
-+ else version (PPC_Any)
-+ {
-+ alias double fenv_t;
-+ alias uint fexcept_t;
-+ }
-+ else version (X86_Any)
- {
- struct fenv_t
- {
-@@ -391,7 +428,8 @@ else version (CRuntime_Musl)
- uint __data_offset;
- ushort __data_selector;
- ushort __unused5;
-- uint __mxcsr;
-+ version (X86_64)
-+ uint __mxcsr;
- }
- alias ushort fexcept_t;
- }
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/dirent.d b/libphobos/libdruntime/core/sys/posix/dirent.d
---- a/libphobos/libdruntime/core/sys/posix/dirent.d 2019-10-28 06:37:30.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/dirent.d 2019-10-28 08:08:09.000000000 +0900
-@@ -506,7 +506,7 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
--
-+ int readdir_r(DIR*, dirent*, dirent**);
- }
- else version (CRuntime_UClibc)
- {
-@@ -591,6 +591,8 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ void seekdir(DIR*, c_long);
-+ c_long telldir(DIR*);
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/pthread.d b/libphobos/libdruntime/core/sys/posix/pthread.d
---- a/libphobos/libdruntime/core/sys/posix/pthread.d 2019-10-28 06:37:30.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/pthread.d 2019-10-28 08:08:09.000000000 +0900
-@@ -854,7 +854,15 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ enum PTHREAD_BARRIER_SERIAL_THREAD = -1;
-
-+ int pthread_barrier_destroy(pthread_barrier_t*);
-+ int pthread_barrier_init(pthread_barrier_t*, in pthread_barrierattr_t*, uint);
-+ int pthread_barrier_wait(pthread_barrier_t*);
-+ int pthread_barrierattr_destroy(pthread_barrierattr_t*);
-+ int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, int*);
-+ int pthread_barrierattr_init(pthread_barrierattr_t*);
-+ int pthread_barrierattr_setpshared(pthread_barrierattr_t*, int);
- }
- else version (CRuntime_UClibc)
- {
-@@ -880,6 +888,55 @@ else
- int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
- int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
- */
-+version (CRuntime_Glibc)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (FreeBSD)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (DragonFlyBSD)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (NetBSD)
-+{
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (OpenBSD)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (Darwin)
-+{
-+}
-+else version (Solaris)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (CRuntime_Bionic)
-+{
-+}
-+else version (CRuntime_Musl)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else version (CRuntime_UClibc)
-+{
-+ int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
-+ int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
-+}
-+else
-+{
-+ static assert(false, "Unsupported platform");
-+}
-
- //
- // Spinlock (SPI)
-@@ -948,7 +1005,11 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
--
-+ int pthread_spin_destroy(pthread_spinlock_t*);
-+ int pthread_spin_init(pthread_spinlock_t*, int);
-+ int pthread_spin_lock(pthread_spinlock_t*);
-+ int pthread_spin_trylock(pthread_spinlock_t*);
-+ int pthread_spin_unlock(pthread_spinlock_t*);
- }
- else version (CRuntime_UClibc)
- {
-@@ -1187,7 +1248,7 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
--
-+ int pthread_getcpuclockid(pthread_t, clockid_t*);
- }
- else version (CRuntime_UClibc)
- {
-@@ -1256,7 +1317,9 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
--
-+ int pthread_mutex_timedlock(pthread_mutex_t*, in timespec*);
-+ int pthread_rwlock_timedrdlock(pthread_rwlock_t*, in timespec*);
-+ int pthread_rwlock_timedwrlock(pthread_rwlock_t*, in timespec*);
- }
- else version (CRuntime_UClibc)
- {
-@@ -1693,7 +1756,12 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
--
-+ int pthread_condattr_getpshared(pthread_condattr_t*, int*);
-+ int pthread_condattr_setpshared(pthread_condattr_t*, int);
-+ int pthread_mutexattr_getpshared(pthread_mutexattr_t*, int*);
-+ int pthread_mutexattr_setpshared(pthread_mutexattr_t*, int);
-+ int pthread_rwlockattr_getpshared(pthread_rwlockattr_t*, int*);
-+ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/pwd.d b/libphobos/libdruntime/core/sys/posix/pwd.d
---- a/libphobos/libdruntime/core/sys/posix/pwd.d 2019-10-28 06:37:30.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/pwd.d 2019-10-28 08:08:09.000000000 +0900
-@@ -172,7 +172,8 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-- struct passwd {
-+ struct passwd
-+ {
- char *pw_name;
- char *pw_passwd;
- uid_t pw_uid;
-@@ -257,6 +258,8 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
-+ int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
- }
- else version (CRuntime_UClibc)
- {
-@@ -325,8 +328,9 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-- int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
-- int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
-+ void endpwent();
-+ passwd* getpwent();
-+ void setpwent();
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d
---- a/libphobos/libdruntime/core/sys/posix/signal.d 2019-10-28 07:12:22.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/signal.d 2019-10-28 08:08:09.000000000 +0900
-@@ -1136,55 +1136,57 @@ else version (NetBSD)
- enum SIG_UNBLOCK = 2;
- enum SIG_SETMASK = 3;
-
-- union sigval_t {
-- int sival_int;
-- void *sival_ptr;
-- };
-- struct _rt{
-- pid_t _pid;
-- uid_t _uid;
-- sigval_t _value;
-- };
-- struct _child{
-- pid_t _pid;
-- uid_t _uid;
-- int _status;
-- clock_t _utime;
-- clock_t _stime;
-- };
-- struct _fault{
-- void *_addr;
-- int _trap;
-- int _trap2;
-- int _trap3;
-- };
-- struct _poll{
-- long _band;
-- int _fd;
-- };
-- union _reason{
-- _rt rt;
-- _child child;
-- _fault fault;
-- _poll poll;
-- };
-- struct _ksiginfo {
-+ union sigval_t
-+ {
-+ int sival_int;
-+ void* sival_ptr;
-+ }
-+
-+ struct _ksiginfo
-+ {
- int _signo;
- int _code;
- int _errno;
--/+#ifdef _LP64
-- /* In _LP64 the union starts on an 8-byte boundary. */
-- int _pad;
--#endif+/
-- _reason reason;
-- };
-+ version (D_LP64)
-+ int _pad;
-
-+ union reason_t
-+ {
-+ struct rt_t
-+ {
-+ pid_t _pid;
-+ uid_t _uid;
-+ sigval_t _value;
-+ } rt_t _rt;
-+ struct child_t
-+ {
-+ pid_t _pid;
-+ uid_t _uid;
-+ int _status;
-+ clock_t _utime;
-+ clock_t _stime;
-+ } child_t _child;
-+ struct fault_t
-+ {
-+ void* _addr;
-+ int _trap;
-+ int _trap2;
-+ int _trap3;
-+ } fault_t fault;
-+ struct poll_t
-+ {
-+ c_long _band;
-+ int _fd;
-+ } poll_t _poll;
-+ }
-+ reason_t _reason;
-+ }
-
- union siginfo_t
- {
-- ubyte[128] si_pad;/* Total size; for future expansion */
-+ ubyte[128] si_pad;
- _ksiginfo _info;
-- @property ref c_long si_band() return { return _info.reason.poll._band; }
-+ @property ref c_long si_band() return { return _info._reason._poll._band; }
- }
-
- enum SI_USER = 0;
-@@ -1589,27 +1591,53 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-- struct sigset_t {
-- ulong[128/long.sizeof] __bits;
-+ struct sigset_t
-+ {
-+ c_ulong[128/c_long.sizeof] __bits;
- }
-
-- enum SIG_BLOCK = 0;
-- enum SIG_UNBLOCK = 1;
-- enum SIG_SETMASK = 2;
-+ version (MIPS_Any)
-+ {
-+ enum SIG_BLOCK = 1;
-+ enum SIG_UNBLOCK = 2;
-+ enum SIG_SETMASK = 3;
-+ }
-+ else
-+ {
-+ enum SIG_BLOCK = 0;
-+ enum SIG_UNBLOCK = 1;
-+ enum SIG_SETMASK = 2;
-+ }
-
-- struct siginfo_t {
-- int si_signo, si_errno, si_code;
-- union __si_fields_t {
-- char[128 - 2*int.sizeof - long.sizeof] __pad = 0;
-- struct __si_common_t {
-- union __first_t {
-- struct __piduid_t {
-+ struct siginfo_t
-+ {
-+ int si_signo;
-+ version (MIPS_Any) // __SI_SWAP_ERRNO_CODE
-+ {
-+ int si_code;
-+ int si_errno;
-+ }
-+ else
-+ {
-+ int si_errno;
-+ int si_code;
-+ }
-+ union __si_fields_t
-+ {
-+ char[128 - 2*int.sizeof - c_long.sizeof] __pad = 0;
-+ struct __si_common_t
-+ {
-+ union __first_t
-+ {
-+ struct __piduid_t
-+ {
- pid_t si_pid;
- uid_t si_uid;
- }
- __piduid_t __piduid;
-
-- struct __timer_t {
-+ struct __timer_t
-+ {
- int si_timerid;
- int si_overrun;
- }
-@@ -1617,11 +1645,14 @@ else version (CRuntime_Musl)
- }
- __first_t __first;
-
-- union __second_t {
-+ union __second_t
-+ {
- sigval si_value;
-- struct __sigchld_t {
-+ struct __sigchld_t
-+ {
- int si_status;
-- clock_t si_utime, si_stime;
-+ clock_t si_utime;
-+ clock_t si_stime;
- }
- __sigchld_t __sigchld;
- }
-@@ -1629,11 +1660,14 @@ else version (CRuntime_Musl)
- }
- __si_common_t __si_common;
-
-- struct __sigfault_t {
-+ struct __sigfault_t
-+ {
- void *si_addr;
- short si_addr_lsb;
-- union __first_t {
-- struct __addr_bnd_t {
-+ union __first_t
-+ {
-+ struct __addr_bnd_t
-+ {
- void *si_lower;
- void *si_upper;
- }
-@@ -1644,13 +1678,15 @@ else version (CRuntime_Musl)
- }
- __sigfault_t __sigfault;
-
-- struct __sigpoll_t {
-- long si_band;
-+ struct __sigpoll_t
-+ {
-+ c_long si_band;
- int si_fd;
- }
- __sigpoll_t __sigpoll;
-
-- struct __sigsys_t {
-+ struct __sigsys_t
-+ {
- void *si_call_addr;
- int si_syscall;
- uint si_arch;
-@@ -3030,7 +3066,177 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-- enum SA_RESTART = 0x10000000;
-+ version (MIPS_Any)
-+ {
-+ enum SIGPOLL = 22;
-+ enum SIGPROF = 29;
-+ enum SIGSYS = 12;
-+ enum SIGTRAP = 5;
-+ enum SIGVTALRM = 28;
-+ enum SIGXCPU = 30;
-+ enum SIGXFSZ = 31;
-+
-+ enum SA_ONSTACK = 0x08000000;
-+ enum SA_RESETHAND = 0x80000000;
-+ enum SA_RESTART = 0x10000000;
-+ enum SA_SIGINFO = 8;
-+ enum SA_NOCLDWAIT = 0x10000;
-+ enum SA_NODEFER = 0x40000000;
-+ }
-+ else
-+ {
-+ enum SIGPOLL = 29;
-+ enum SIGPROF = 27;
-+ enum SIGSYS = 31;
-+ enum SIGTRAP = 5;
-+ enum SIGVTALRM = 26;
-+ enum SIGXCPU = 24;
-+ enum SIGXFSZ = 25;
-+
-+ enum SA_ONSTACK = 0x08000000;
-+ enum SA_RESETHAND = 0x80000000;
-+ enum SA_RESTART = 0x10000000;
-+ enum SA_SIGINFO = 4;
-+ enum SA_NOCLDWAIT = 2;
-+ enum SA_NODEFER = 0x40000000;
-+ }
-+
-+ enum SS_ONSTACK = 1;
-+ enum SS_DISABLE = 2;
-+
-+ version (ARM)
-+ {
-+ enum MINSIGSTKSZ = 2048;
-+ enum SIGSTKSZ = 8192;
-+ }
-+ else version (AArch64)
-+ {
-+ enum MINSIGSTKSZ = 6144;
-+ enum SIGSTKSZ = 12288;
-+ }
-+ else version (IBMZ_Any)
-+ {
-+ enum MINSIGSTKSZ = 4096;
-+ enum SIGSTKSZ = 10240;
-+ }
-+ else version (MIPS_Any)
-+ {
-+ enum MINSIGSTKSZ = 2048;
-+ enum SIGSTKSZ = 8192;
-+ }
-+ else version (PPC_Any)
-+ {
-+ enum MINSIGSTKSZ = 4096;
-+ enum SIGSTKSZ = 10240;
-+ }
-+ else version (X86_Any)
-+ {
-+ enum MINSIGSTKSZ = 2048;
-+ enum SIGSTKSZ = 8192;
-+ }
-+ else
-+ static assert(0, "unimplemented");
-+
-+ //ucontext_t (defined in core.sys.posix.ucontext)
-+ //mcontext_t (defined in core.sys.posix.ucontext)
-+
-+ version (MIPS_Any)
-+ {
-+ struct stack_t
-+ {
-+ void* ss_sp;
-+ size_t ss_size;
-+ int ss_flags;
-+ }
-+ }
-+ else
-+ {
-+ struct stack_t
-+ {
-+ void* ss_sp;
-+ int ss_flags;
-+ size_t ss_size;
-+ }
-+ }
-+
-+ enum
-+ {
-+ ILL_ILLOPC = 1,
-+ ILL_ILLOPN,
-+ ILL_ILLADR,
-+ ILL_ILLTRP,
-+ ILL_PRVOPC,
-+ ILL_PRVREG,
-+ ILL_COPROC,
-+ ILL_BADSTK
-+ }
-+
-+ enum
-+ {
-+ FPE_INTDIV = 1,
-+ FPE_INTOVF,
-+ FPE_FLTDIV,
-+ FPE_FLTOVF,
-+ FPE_FLTUND,
-+ FPE_FLTRES,
-+ FPE_FLTINV,
-+ FPE_FLTSUB
-+ }
-+
-+ enum
-+ {
-+ SEGV_MAPERR = 1,
-+ SEGV_ACCERR
-+ }
-+
-+ enum
-+ {
-+ BUS_ADRALN = 1,
-+ BUS_ADRERR,
-+ BUS_OBJERR
-+ }
-+
-+ enum
-+ {
-+ TRAP_BRKPT = 1,
-+ TRAP_TRACE
-+ }
-+
-+ enum
-+ {
-+ CLD_EXITED = 1,
-+ CLD_KILLED,
-+ CLD_DUMPED,
-+ CLD_TRAPPED,
-+ CLD_STOPPED,
-+ CLD_CONTINUED
-+ }
-+
-+ enum
-+ {
-+ POLL_IN = 1,
-+ POLL_OUT,
-+ POLL_MSG,
-+ POLL_ERR,
-+ POLL_PRI,
-+ POLL_HUP
-+ }
-+
-+ sigfn_t bsd_signal(int sig, sigfn_t func);
-+ sigfn_t sigset(int sig, sigfn_t func);
-+
-+ nothrow:
-+ @nogc:
-+ sigfn_t2 bsd_signal(int sig, sigfn_t2 func);
-+ sigfn_t2 sigset(int sig, sigfn_t2 func);
-+
-+ int killpg(pid_t, int);
-+ int sigaltstack(const scope stack_t*, stack_t*);
-+ int sighold(int);
-+ int sigignore(int);
-+ int siginterrupt(int, int);
-+ int sigpause(int);
-+ int sigrelse(int);
- }
- else version (CRuntime_UClibc)
- {
-@@ -3483,7 +3689,7 @@ else version (CRuntime_Musl)
- int sigev_notify;
- void function(sigval) sigev_notify_function;
- pthread_attr_t *sigev_notify_attributes;
-- char[56 - 3 * long.sizeof] __pad = void;
-+ char[56 - 3 * c_long.sizeof] __pad = void;
- }
- }
- else version (CRuntime_UClibc)
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d
---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d 2019-10-28 07:12:22.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d 2019-10-28 08:08:09.000000000 +0900
-@@ -128,6 +128,15 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ enum
-+ {
-+ POSIX_MADV_NORMAL = 0,
-+ POSIX_MADV_RANDOM = 1,
-+ POSIX_MADV_SEQUENTIAL = 2,
-+ POSIX_MADV_WILLNEED = 3,
-+ POSIX_MADV_DONTNEED = 4,
-+ }
-+ int posix_madvise(void *, size_t, int);
- }
- else version (CRuntime_UClibc)
- {
-@@ -611,6 +620,14 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ enum
-+ {
-+ MCL_CURRENT = 1,
-+ MCL_FUTURE = 2,
-+ }
-+
-+ int mlockall(int);
-+ int munlockall();
- }
- else version (CRuntime_UClibc)
- {
-@@ -674,6 +691,8 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ int mlock(in void*, size_t);
-+ int munlock(in void*, size_t);
- }
- else version (CRuntime_UClibc)
- {
-@@ -776,6 +795,8 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ int shm_open(in char*, int, mode_t);
-+ int shm_unlink(in char*);
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
---- a/libphobos/libdruntime/core/sys/posix/sys/socket.d 2019-10-28 07:12:22.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d 2019-10-28 08:08:09.000000000 +0900
-@@ -1755,10 +1755,10 @@ else version (CRuntime_Musl)
- c_ulong __ss_align;
- }
-
-- enum {
-+ enum
-+ {
- SOCK_STREAM = 1,
- SOCK_DGRAM = 2,
-- SOCK_RAW = 3,
- SOCK_RDM = 4,
- SOCK_SEQPACKET = 5,
- SOCK_DCCP = 6,
-@@ -2187,6 +2187,10 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ enum
-+ {
-+ SOCK_RAW = 3
-+ }
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d
---- a/libphobos/libdruntime/core/sys/posix/sys/types.d 2019-10-28 07:12:22.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/sys/types.d 2019-10-28 08:07:51.000000000 +0900
-@@ -112,20 +112,25 @@ version (CRuntime_Glibc)
- }
- else version (CRuntime_Musl)
- {
-- alias long blksize_t;
-- alias ulong nlink_t;
-- alias long dev_t;
-- alias long blkcnt_t;
-- alias ulong ino_t;
-- alias long off_t;
-- alias long _Addr;
-- alias int pid_t;
-- alias uint uid_t;
-- alias uint gid_t;
-- alias long time_t;
-- alias long clock_t;
-- alias ulong pthread_t;
-- alias _Addr ssize_t;
-+ alias c_long blksize_t;
-+ alias c_ulong nlink_t;
-+ alias long dev_t;
-+ alias long blkcnt_t;
-+ alias ulong ino_t;
-+ alias long off_t;
-+ alias int pid_t;
-+ alias uint uid_t;
-+ alias uint gid_t;
-+ version (D_X32)
-+ alias long time_t;
-+ else
-+ alias c_long time_t;
-+ alias c_long clock_t;
-+ alias c_ulong pthread_t;
-+ version (D_LP64)
-+ alias c_long ssize_t;
-+ else
-+ alias int ssize_t;
- }
- else version (Darwin)
- {
-@@ -420,7 +425,10 @@ else version (CRuntime_Musl)
- }
- alias uint mode_t;
- alias uint id_t;
-- alias long suseconds_t;
-+ version (D_X32)
-+ alias long susseconds_t;
-+ else
-+ alias c_long suseconds_t;
- }
- else version (CRuntime_UClibc)
- {
-@@ -723,40 +746,77 @@ version (CRuntime_Glibc)
- }
- else version (CRuntime_Musl)
- {
-- version (X86_64) {
-+ version (D_LP64)
-+ {
- union pthread_attr_t
- {
- int[14] __i;
- ulong[7] __s;
- }
-+
- union pthread_cond_t
- {
- int[12] __i;
- void*[6] __p;
- }
-+
- union pthread_mutex_t
- {
- int[10] __i;
- void*[5] __p;
- }
-+
- union pthread_rwlock_t
- {
- int[14] __i;
- void*[7] __p;
- }
-- struct pthread_rwlockattr_t
-+ }
-+ else
-+ {
-+ union pthread_attr_t
-+ {
-+ int[9] __i;
-+ uint[9] __s;
-+ }
-+
-+ union pthread_cond_t
-+ {
-+ int[12] __i;
-+ void*[12] __p;
-+ }
-+
-+ union pthread_mutex_t
- {
-- uint[2] __attr;
-+ int[6] __i;
-+ void*[6] __p;
-+ }
-+
-+ union pthread_rwlock_t
-+ {
-+ int[8] __i;
-+ void*[8] __p;
- }
-- alias uint pthread_key_t;
-- alias uint pthread_condattr_t;
-- alias uint pthread_mutexattr_t;
-- alias int pthread_once_t;
- }
-- else
-+
-+ struct pthread_rwlockattr_t
- {
-- static assert (false, "Architecture unsupported");
-+ uint[2] __attr;
- }
-+
-+ alias uint pthread_key_t;
-+
-+ struct pthread_condattr_t
-+ {
-+ uint __attr;
-+ }
-+
-+ struct pthread_mutexattr_t
-+ {
-+ uint __attr;
-+ }
-+
-+ alias int pthread_once_t;
- }
- else version (Darwin)
- {
-@@ -1300,6 +1360,27 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ version (D_LP64)
-+ {
-+ union pthread_barrier_t
-+ {
-+ int[8] __i;
-+ void*[4] __p;
-+ }
-+ }
-+ else
-+ {
-+ union pthread_barrier_t
-+ {
-+ int[5] __i;
-+ void*[5] __p;
-+ }
-+ }
-+
-+ struct pthread_barrierattr_t
-+ {
-+ uint __attr;
-+ }
- }
- else version (CRuntime_UClibc)
- {
-@@ -1351,6 +1432,10 @@ else version (CRuntime_UClibc)
- {
- alias int pthread_spinlock_t; // volatile
- }
-+else version (CRuntime_Musl)
-+{
-+ alias int pthread_spinlock_t;
-+}
-
- //
- // Timer (TMR)
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/wait.d b/libphobos/libdruntime/core/sys/posix/sys/wait.d
---- a/libphobos/libdruntime/core/sys/posix/sys/wait.d 2019-10-28 07:12:22.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/sys/wait.d 2019-10-28 08:08:09.000000000 +0900
-@@ -362,6 +362,19 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-+ enum WEXITED = 4;
-+ enum WSTOPPED = 2;
-+ enum WCONTINUED = 8;
-+ enum WNOWAIT = 0x01000000;
-+
-+ enum idtype_t
-+ {
-+ P_ALL,
-+ P_PID,
-+ P_PGID
-+ }
-+
-+ int waitid(idtype_t, id_t, siginfo_t*, int);
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
---- a/libphobos/libdruntime/core/sys/posix/ucontext.d 2019-10-28 07:12:22.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d 2019-10-28 08:08:09.000000000 +0900
-@@ -23,6 +23,10 @@ extern (C):
- nothrow:
- @nogc:
-
-+version (MIPS32) version = MIPS_Any;
-+version (MIPS64) version = MIPS_Any;
-+version (PPC) version = PPC_Any;
-+version (PPC64) version = PPC_Any;
- version (RISCV32) version = RISCV_Any;
- version (RISCV64) version = RISCV_Any;
- version (S390) version = IBMZ_Any;
-@@ -770,6 +774,139 @@ version (CRuntime_Glibc)
- else
- static assert(0, "unimplemented");
- }
-+else version (CRuntime_Musl)
-+{
-+ version (AArch64)
-+ {
-+ struct mcontext_t
-+ {
-+ real[18+256] __regs;
-+ }
-+
-+ struct ucontext_t
-+ {
-+ c_ulong uc_flags;
-+ ucontext_t* uc_link;
-+ stack_t uc_stack;
-+ sigset_t uc_sigmask;
-+ mcontext_t uc_mcontext;
-+ }
-+ }
-+ else version (ARM)
-+ {
-+ struct mcontext_t
-+ {
-+ c_ulong[21] __regs;
-+ }
-+
-+ struct ucontext_t
-+ {
-+ c_ulong uc_flags;
-+ ucontext_t* uc_link;
-+ stack_t uc_stack;
-+ mcontext_t uc_mcontext;
-+ sigset_t uc_sigmask;
-+ ulong[64] uc_regspace;
-+ }
-+ }
-+ else version (IBMZ_Any)
-+ {
-+ struct mcontext_t
-+ {
-+ c_ulong[18] __regs1;
-+ uint[18] __regs2;
-+ double[16] __regs3;
-+ }
-+
-+ struct ucontext_t
-+ {
-+ c_ulong uc_flags;
-+ ucontext_t* uc_link;
-+ stack_t uc_stack;
-+ mcontext_t uc_mcontext;
-+ sigset_t uc_sigmask;
-+ }
-+ }
-+ else version (MIPS_Any)
-+ {
-+ version (MIPS_N32)
-+ {
-+ struct mcontext_t
-+ {
-+ ulong[32] __mc1;
-+ double[32] __mc2;
-+ ulong[9] __mc3;
-+ uint[4] __mc4;
-+ }
-+ }
-+ else version (MIPS64)
-+ {
-+ struct mcontext_t
-+ {
-+ ulong[32] __mc1;
-+ double[32] __mc2;
-+ ulong[9] __mc3;
-+ uint[4] __mc4;
-+ }
-+ }
-+ else
-+ {
-+ struct mcontext_t
-+ {
-+ uint[2] __mc1;
-+ ulong[65] __mc2;
-+ uint[5] __mc3;
-+ ulong[2] __mc4;
-+ uint[6] __mc5;
-+ }
-+ }
-+
-+ struct ucontext_t
-+ {
-+ c_ulong uc_flags;
-+ ucontext_t* uc_link;
-+ stack_t uc_stack;
-+ mcontext_t uc_mcontext;
-+ sigset_t uc_sigmask;
-+ }
-+ }
-+ else version (X86)
-+ {
-+ struct mcontext_t
-+ {
-+ uint[22] __space;
-+ }
-+
-+ struct ucontext_t
-+ {
-+ c_ulong uc_flags;
-+ ucontext_t* uc_link;
-+ stack_t uc_stack;
-+ mcontext_t uc_mcontext;
-+ sigset_t uc_sigmask;
-+ c_ulong[28] __fpregs_mem;
-+ }
-+ }
-+ else version (X86_64)
-+ {
-+ struct mcontext_t
-+ {
-+ ulong[32] __space;
-+ }
-+
-+ struct ucontext_t
-+ {
-+ c_ulong uc_flags;
-+ ucontext_t* uc_link;
-+ stack_t uc_stack;
-+ mcontext_t uc_mcontext;
-+ sigset_t uc_sigmask;
-+ ulong[64] __fpregs_mem;
-+ }
-+ }
-+ else
-+ static assert(0, "unimplemented");
-+}
- else version (FreeBSD)
- {
- // <machine/ucontext.h>
-diff -Nurp a/libphobos/src/std/experimental/allocator/building_blocks/region.d b/libphobos/src/std/experimental/allocator/building_blocks/region.d
---- a/libphobos/src/std/experimental/allocator/building_blocks/region.d 2019-10-28 07:23:27.000000000 +0900
-+++ b/libphobos/src/std/experimental/allocator/building_blocks/region.d 2019-10-28 08:08:09.000000000 +0900
-@@ -580,6 +580,12 @@ struct InSituRegion(size_t size, size_t
- assert(a.length == 2001);
- }
-
-+version(CRuntime_Musl)
-+{
-+ // sbrk and brk are disabled in Musl:
-+ // https://git.musl-libc.org/cgit/musl/commit/?id=7a995fe706e519a4f55399776ef0df9596101f93
-+ // https://git.musl-libc.org/cgit/musl/commit/?id=863d628d93ea341b6a32661a1654320ce69f6a07
-+} else:
- private extern(C) void* sbrk(long);
- private extern(C) int brk(shared void*);
-
-diff -Nurp a/libphobos/src/std/socket.d b/libphobos/src/std/socket.d
---- a/libphobos/src/std/socket.d 2019-10-28 07:23:27.000000000 +0900
-+++ b/libphobos/src/std/socket.d 2019-10-28 08:08:09.000000000 +0900
-@@ -163,47 +163,7 @@ string formatSocketError(int err) @trust
- {
- cs = strerror_r(err, buf.ptr, buf.length);
- }
-- else version (OSX)
-- {
-- auto errs = strerror_r(err, buf.ptr, buf.length);
-- if (errs == 0)
-- cs = buf.ptr;
-- else
-- return "Socket error " ~ to!string(err);
-- }
-- else version (FreeBSD)
-- {
-- auto errs = strerror_r(err, buf.ptr, buf.length);
-- if (errs == 0)
-- cs = buf.ptr;
-- else
-- return "Socket error " ~ to!string(err);
-- }
-- else version (NetBSD)
-- {
-- auto errs = strerror_r(err, buf.ptr, buf.length);
-- if (errs == 0)
-- cs = buf.ptr;
-- else
-- return "Socket error " ~ to!string(err);
-- }
-- else version (DragonFlyBSD)
-- {
-- auto errs = strerror_r(err, buf.ptr, buf.length);
-- if (errs == 0)
-- cs = buf.ptr;
-- else
-- return "Socket error " ~ to!string(err);
-- }
-- else version (Solaris)
-- {
-- auto errs = strerror_r(err, buf.ptr, buf.length);
-- if (errs == 0)
-- cs = buf.ptr;
-- else
-- return "Socket error " ~ to!string(err);
-- }
-- else version (CRuntime_Bionic)
-+ else
- {
- auto errs = strerror_r(err, buf.ptr, buf.length);
- if (errs == 0)
-@@ -211,8 +171,6 @@ string formatSocketError(int err) @trust
- else
- return "Socket error " ~ to!string(err);
- }
-- else
-- static assert(0);
-
- auto len = strlen(cs);
-
-diff -Nurp a/libphobos/src/std/stdio.d b/libphobos/src/std/stdio.d
---- a/libphobos/src/std/stdio.d 2019-10-28 07:23:27.000000000 +0900
-+++ b/libphobos/src/std/stdio.d 2019-10-28 08:08:09.000000000 +0900
-@@ -44,38 +44,38 @@ version (CRuntime_Glibc)
- version = GCC_IO;
- version = HAS_GETDELIM;
- }
--
--version (OSX)
-+else version (CRuntime_Bionic)
- {
- version = GENERIC_IO;
- version = HAS_GETDELIM;
- }
--
--version (FreeBSD)
-+else version (CRuntime_Musl)
- {
- version = GENERIC_IO;
- version = HAS_GETDELIM;
- }
-
--version (NetBSD)
-+version (OSX)
- {
- version = GENERIC_IO;
- version = HAS_GETDELIM;
- }
--
--version (DragonFlyBSD)
-+else version (FreeBSD)
- {
- version = GENERIC_IO;
- version = HAS_GETDELIM;
- }
--
--version (Solaris)
-+else version (NetBSD)
- {
- version = GENERIC_IO;
-- version = NO_GETDELIM;
-+ version = HAS_GETDELIM;
- }
--
--version (CRuntime_Bionic)
-+else version (DragonFlyBSD)
-+{
-+ version = GENERIC_IO;
-+ version = HAS_GETDELIM;
-+}
-+else version (Solaris)
- {
- version = GENERIC_IO;
- version = NO_GETDELIM;
diff --git a/main/gcc/401-dlang-32bits.patch b/main/gcc/401-dlang-32bits.patch
deleted file mode 100644
index 6072546f7b..0000000000
--- a/main/gcc/401-dlang-32bits.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/libphobos/libdruntime/core/sys/posix/config.d 2019-10-29 15:54:05.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/config.d 2019-10-29 15:54:08.000000000 +0900
-@@ -67,15 +67,21 @@ version (CRuntime_Glibc)
- }
- else version (CRuntime_Musl)
- {
-+ // off_t is always 64 bits on Musl
- enum _FILE_OFFSET_BITS = 64;
-
-+ // Not present in Musl sources
- enum __REDIRECT = false;
-
-+ // Those three are irrelevant for Musl as it always uses 64 bits off_t
- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64;
- enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT;
- enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT;
-
-- enum __WORDSIZE=64;
-+ version (D_LP64)
-+ enum __WORDSIZE = 64;
-+ else
-+ enum __WORDSIZE = 32;
- }
- else version (CRuntime_UClibc)
- {
diff --git a/main/gcc/402-dlang-stat.patch b/main/gcc/402-dlang-stat.patch
deleted file mode 100644
index faf4ed731f..0000000000
--- a/main/gcc/402-dlang-stat.patch
+++ /dev/null
@@ -1,448 +0,0 @@
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
---- a/libphobos/libdruntime/core/sys/posix/fcntl.d 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d 2020-01-01 00:00:00.000000000 +0900
-@@ -779,7 +779,102 @@ else version (CRuntime_Bionic)
- }
- else version (CRuntime_Musl)
- {
-- enum {
-+ version (X86_64)
-+ {
-+ enum
-+ {
-+ O_DIRECTORY = 0x010000, // octal 0200000
-+ O_NOFOLLOW = 0x020000, // octal 0400000
-+ O_DIRECT = 0x004000, // octal 040000
-+ O_LARGEFILE = 0,
-+ O_TMPFILE = 0x410000, // octal 020200000
-+
-+ F_GETLK = 5,
-+ F_SETLK = 6,
-+ F_SETLKW = 7,
-+ }
-+ }
-+ // Note: Definitions for i386 are in arch/generic/bits/fcntl.h
-+ else version (X86)
-+ {
-+ enum
-+ {
-+ O_DIRECTORY = 0x010000, // octal 0200000
-+ O_NOFOLLOW = 0x020000, // octal 0400000
-+ O_DIRECT = 0x004000, // octal 040000
-+ O_LARGEFILE = 0x008000, // octal 0100000
-+ O_TMPFILE = 0x410000, // octal 020200000
-+
-+ F_GETLK = 12,
-+ F_SETLK = 13,
-+ F_SETLKW = 14,
-+ }
-+ }
-+ else version (ARM)
-+ {
-+ enum
-+ {
-+ O_DIRECTORY = 0x004000, // octal 040000
-+ O_NOFOLLOW = 0x008000, // octal 0100000
-+ O_DIRECT = 0x010000, // octal 0200000
-+ O_LARGEFILE = 0x020000, // octal 0400000
-+ O_TMPFILE = 0x404000, // octal 020040000
-+
-+ F_GETLK = 12,
-+ F_SETLK = 13,
-+ F_SETLKW = 14,
-+ }
-+ }
-+ else version (AArch64)
-+ {
-+ enum
-+ {
-+ O_DIRECTORY = 0x004000, // octal 040000
-+ O_NOFOLLOW = 0x008000, // octal 0100000
-+ O_DIRECT = 0x010000, // octal 0200000
-+ O_LARGEFILE = 0x020000, // octal 0400000
-+ O_TMPFILE = 0x404000, // octal 020040000
-+
-+ F_GETLK = 5,
-+ F_SETLK = 6,
-+ F_SETLKW = 7,
-+ }
-+ }
-+ else version (SystemZ)
-+ {
-+ enum
-+ {
-+ O_DIRECTORY = 0x010000, // octal 0200000
-+ O_NOFOLLOW = 0x020000, // octal 0400000
-+ O_DIRECT = 0x004000, // octal 040000
-+ O_LARGEFILE = 0x008000, // octal 0100000
-+ O_TMPFILE = 0x410000, // octal 020200000
-+
-+ F_GETLK = 5,
-+ F_SETLK = 6,
-+ F_SETLKW = 7,
-+ }
-+ }
-+ else version (PPC64)
-+ {
-+ enum
-+ {
-+ O_DIRECTORY = 0x004000, // octal 040000
-+ O_NOFOLLOW = 0x008000, // octal 0100000
-+ O_DIRECT = 0x020000, // octal 0400000
-+ O_LARGEFILE = 0x010000, // octal 0200000
-+ O_TMPFILE = 0x410000, // octal 020200000
-+
-+ F_GETLK = 5,
-+ F_SETLK = 6,
-+ F_SETLKW = 7,
-+ }
-+ }
-+ else
-+ static assert(0, "Platform not supported");
-+
-+ enum
-+ {
- O_CREAT = 0x40, // octal 0100
- O_EXCL = 0x80, // octal 0200
- O_NOCTTY = 0x100, // octal 0400
-@@ -790,16 +885,11 @@ else version (CRuntime_Musl)
- O_DSYNC = 0x1000, // octal 010000
- O_SYNC = 0x101000, // octal 04010000
- O_RSYNC = O_SYNC,
-- O_DIRECTORY = 0x10000,
-- O_NOFOLLOW = 0x20000,
- O_CLOEXEC = 0x80000,
-
- O_ASYNC = 0x2000,
-- O_DIRECT = 0x4000,
-- O_LARGEFILE = 0,
- O_NOATIME = 0x40000,
- O_PATH = 0x200000,
-- O_TMPFILE = 0x410000,
- O_NDELAY = O_NONBLOCK,
- O_SEARCH = O_PATH,
- O_EXEC = O_PATH,
-@@ -809,19 +899,19 @@ else version (CRuntime_Musl)
- O_WRONLY = 01,
- O_RDWR = 02,
- }
-- enum {
-+ enum
-+ {
- F_DUPFD = 0,
- F_GETFD = 1,
- F_SETFD = 2,
- F_GETFL = 3,
- F_SETFL = 4,
-- F_GETLK = 5,
-- F_SETLK = 6,
-- F_SETLKW = 7,
-+ // F_GETLK, F_SETLK, F_SETLKW are arch-specific
- F_SETOWN = 8,
- F_GETOWN = 9,
- }
-- enum {
-+ enum
-+ {
- F_RDLCK = 0,
- F_WRLCK = 1,
- F_UNLCK = 2,
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/semaphore.d b/libphobos/libdruntime/core/sys/posix/semaphore.d
---- a/libphobos/libdruntime/core/sys/posix/semaphore.d 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/semaphore.d 2020-01-01 00:00:00.000000000 +0900
-@@ -143,8 +143,10 @@ else version (CRuntime_Bionic)
- else version (CRuntime_Musl)
- {
- struct sem_t {
-- int[4*long.sizeof/int.sizeof] __val;
-+ int[4*c_long.sizeof/int.sizeof] __val;
- }
-+
-+ enum SEM_FAILED = (sem_t*).init;
- }
- else version (CRuntime_UClibc)
- {
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/stat.d b/libphobos/libdruntime/core/sys/posix/sys/stat.d
---- a/libphobos/libdruntime/core/sys/posix/sys/stat.d 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d 2020-01-01 00:00:00.000000000 +0900
-@@ -1587,31 +1587,225 @@ else version (CRuntime_Musl)
- S_ISGID = 0x400, // octal 02000
- S_ISVTX = 0x200, // octal 01000
- }
-- struct stat_t {
-- dev_t st_dev;
-- ino_t st_ino;
-- nlink_t st_nlink;
--
-- mode_t st_mode;
-- uid_t st_uid;
-- gid_t st_gid;
-- uint __pad0;
-- dev_t st_rdev;
-- off_t st_size;
-- blksize_t st_blksize;
-- blkcnt_t st_blocks;
--
-- timespec st_atim;
-- timespec st_mtim;
-- timespec st_ctim;
-- extern(D) @safe @property inout pure nothrow
-- {
-- ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-- ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-- ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ version (ARM)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ int __st_dev_padding;
-+ c_long __st_ino_truncated;
-+ mode_t st_mode;
-+ nlink_t st_nlink;
-+
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ int __st_rdev_padding;
-+ off_t st_size;
-+ blksize_t st_blksize;
-+ blkcnt_t st_blocks;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+ ino_t st_ino;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
-+ }
-+ }
-+ else version (AArch64)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ ino_t st_ino;
-+ mode_t st_mode;
-+ nlink_t st_nlink;
-+
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ c_ulong __pad;
-+ off_t st_size;
-+ blksize_t st_blksize;
-+ int __pad2;
-+ blkcnt_t st_blocks;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+ uint[2] __unused;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
-+ }
-+ }
-+ else version (X86_64)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ ino_t st_ino;
-+ nlink_t st_nlink;
-+
-+ mode_t st_mode;
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ uint __pad0;
-+ dev_t st_rdev;
-+ off_t st_size;
-+ blksize_t st_blksize;
-+ blkcnt_t st_blocks;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+
-+ c_long[3] __unused;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
-+ }
-+ }
-+ else version (X86)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ int __st_dev_padding;
-+ c_long __st_ino_truncated;
-+ mode_t st_mode;
-+ nlink_t st_nlink;
-+
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ int __st_rdev_padding;
-+ off_t st_size;
-+ blksize_t st_blksize;
-+ blkcnt_t st_blocks;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+ ino_t st_ino;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
- }
-- long[3] __unused;
- }
-+ else version (MIPS64)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ int[3] __pad1;
-+ ino_t st_ino;
-+ mode_t st_mode;
-+ nlink_t st_nlink;
-+
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ uint[2] __pad2;
-+ off_t st_size;
-+ int __pad3;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+ blksize_t st_blksize;
-+ uint __pad4;
-+ blkcnt_t st_blocks;
-+ int[14] __pad5;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
-+ }
-+ }
-+ else version (PPC64)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ ino_t st_ino;
-+ nlink_t st_nlink;
-+ mode_t st_mode;
-+
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ off_t st_size;
-+ blksize_t st_blksize;
-+ blkcnt_t st_blocks;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+ c_ulong[3] __unused;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
-+ }
-+ }
-+ else version (SystemZ)
-+ {
-+ struct stat_t
-+ {
-+ dev_t st_dev;
-+ ino_t st_ino;
-+ nlink_t st_nlink;
-+ mode_t st_mode;
-+
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ off_t st_size;
-+
-+ timespec st_atim;
-+ timespec st_mtim;
-+ timespec st_ctim;
-+
-+ blksize_t st_blksize;
-+ blkcnt_t st_blocks;
-+ c_ulong[3] __unused;
-+
-+ extern(D) @safe @property inout pure nothrow
-+ {
-+ ref inout(time_t) st_atime() return { return st_atim.tv_sec; }
-+ ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; }
-+ ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; }
-+ }
-+ }
-+ }
-+ else
-+ static assert("Unsupported platform");
-+
- private
- {
- extern (D) bool S_ISTYPE( mode_t mode, uint mask )
-diff -Nurp a/libphobos/libdruntime/core/sys/posix/sys/types.d b/libphobos/libdruntime/core/sys/posix/sys/types.d
---- a/libphobos/libdruntime/core/sys/posix/sys/types.d 2020-01-08 00:00:00.000000000 +0900
-+++ b/libphobos/libdruntime/core/sys/posix/sys/types.d 2020-01-08 00:00:00.000000000 +0900
-@@ -112,8 +112,26 @@ version (CRuntime_Glibc)
- }
- else version (CRuntime_Musl)
- {
-- alias c_long blksize_t;
-- alias c_ulong nlink_t;
-+ version (AArch64)
-+ {
-+ alias int blksize_t;
-+ alias uint nlink_t;
-+ }
-+ else version (MIPS64)
-+ {
-+ alias c_long blksize_t;
-+ alias uint nlink_t;
-+ }
-+ else version (RISCV64)
-+ {
-+ alias int blksize_t;
-+ alias uint nlink_t;
-+ }
-+ else
-+ {
-+ alias c_long blksize_t;
-+ alias c_ulong nlink_t;
-+ }
- alias long dev_t;
- alias long blkcnt_t;
- alias ulong ino_t;
diff --git a/main/gcc/403-dlang-ibmz.patch b/main/gcc/403-dlang-ibmz.patch
deleted file mode 100644
index f6f9a2ce0c..0000000000
--- a/main/gcc/403-dlang-ibmz.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-diff -Nurp a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d
---- a/libphobos/libdruntime/gcc/sections/elf_shared.d 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/libdruntime/gcc/sections/elf_shared.d 2020-01-01 00:00:00.000000000 +0900
-@@ -1084,7 +1084,9 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc
-
- // base offset
- auto ti = tls_index(mod, 0);
-- version (IBMZ_Any)
-+ version (CRuntime_Musl)
-+ return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz];
-+ else version (IBMZ_Any)
- {
- auto idx = cast(void *)__tls_get_addr_internal(&ti)
- + cast(ulong)__builtin_thread_pointer();
-diff -Nurp a/libphobos/configure.ac b/libphobos/configure.ac
---- a/libphobos/configure.ac 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/configure.ac 2020-01-01 00:00:00.000000000 +0900
-@@ -140,6 +140,14 @@ case ${host} in
- esac
- AC_MSG_RESULT($LIBPHOBOS_SUPPORTED)
-
-+AC_MSG_CHECKING([if target needs to link in swapcontext])
-+AC_MSG_RESULT($LIBDRUNTIME_NEEDS_UCONTEXT)
-+AS_IF([test "x$LIBDRUNTIME_NEEDS_UCONTEXT" = xyes], [
-+ AC_SEARCH_LIBS([swapcontext], [c ucontext], [], [
-+ AC_MSG_ERROR([[can't find library providing swapcontext]])
-+ ])
-+])
-+
- # Decide if it's usable.
- case $LIBPHOBOS_SUPPORTED:$enable_libphobos in
- *:no) use_libphobos=no ;;
-diff -Nurp a/libphobos/configure.tgt b/libphobos/configure.tgt
---- a/libphobos/configure.tgt 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/configure.tgt 2020-01-01 00:00:00.000000000 +0900
-@@ -22,6 +22,13 @@
- # Disable the libphobos or libdruntime components on untested or known
- # broken systems. More targets shall be added after testing.
- LIBPHOBOS_SUPPORTED=no
-+
-+# Check if we require 'ucontext' or if we have a custom solution.
-+# Most platform uses a custom assembly solution for context switches,
-+# see `core.thread` and grep for `AsmExternal`.
-+# Definitions are in config/ARCH/
-+LIBPHOBOS_NEEDS_UCONTEXT=no
-+
- case "${target}" in
- aarch64*-*-linux*)
- LIBPHOBOS_SUPPORTED=yes
-@@ -37,6 +44,7 @@ case "${target}" in
- ;;
- s390*-linux*)
- LIBPHOBOS_SUPPORTED=yes
-+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
- ;;
- x86_64-*-kfreebsd*-gnu | i?86-*-kfreebsd*-gnu)
- LIBPHOBOS_SUPPORTED=yes
-diff -Nurp a/libphobos/configure b/libphobos/configure
---- a/libphobos/configure 2020-01-01 00:00:00.000000000 +0900
-+++ b/libphobos/configure 2020-01-01 00:00:00.000000000 +0900
-@@ -13955,6 +13955,76 @@ esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBPHOBOS_SUPPORTED" >&5
- $as_echo "$LIBPHOBOS_SUPPORTED" >&6; }
-
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if target needs to link in swapcontext" >&5
-+$as_echo_n "checking if target needs to link in swapcontext... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBDRUNTIME_NEEDS_UCONTEXT" >&5
-+$as_echo "$LIBDRUNTIME_NEEDS_UCONTEXT" >&6; }
-+if test "x$LIBDRUNTIME_NEEDS_UCONTEXT" = xyes; then :
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5
-+$as_echo_n "checking for library containing swapcontext... " >&6; }
-+if ${ac_cv_search_swapcontext+:} false; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_func_search_save_LIBS=$LIBS
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char swapcontext ();
-+int
-+main ()
-+{
-+return swapcontext ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+for ac_lib in '' c ucontext; do
-+ if test -z "$ac_lib"; then
-+ ac_res="none required"
-+ else
-+ ac_res=-l$ac_lib
-+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
-+ fi
-+ if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_search_swapcontext=$ac_res
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext
-+ if ${ac_cv_search_swapcontext+:} false; then :
-+ break
-+fi
-+done
-+if ${ac_cv_search_swapcontext+:} false; then :
-+
-+else
-+ ac_cv_search_swapcontext=no
-+fi
-+rm conftest.$ac_ext
-+LIBS=$ac_func_search_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_swapcontext" >&5
-+$as_echo "$ac_cv_search_swapcontext" >&6; }
-+ac_res=$ac_cv_search_swapcontext
-+if test "$ac_res" != no; then :
-+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-+
-+else
-+
-+ as_fn_error $? "can't find library providing swapcontext" "$LINENO" 5
-+
-+fi
-+
-+
-+fi
-+
-+
- # Decide if it's usable.
- case $LIBPHOBOS_SUPPORTED:$enable_libphobos in
- *:no) use_libphobos=no ;;
diff --git a/main/gcc/405-dlang-mips.patch b/main/gcc/405-dlang-mips.patch
deleted file mode 100644
index 1b222a0d43..0000000000
--- a/main/gcc/405-dlang-mips.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- gcc-9.3.0.orig/libphobos/libdruntime/core/sys/posix/fcntl.d
-+++ gcc-9.3.0/libphobos/libdruntime/core/sys/posix/fcntl.d
-@@ -870,6 +870,21 @@
- 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");
-
---- gcc-9.3.0.orig/libphobos/configure.tgt
-+++ gcc-9.3.0/libphobos/configure.tgt
-@@ -38,6 +38,7 @@
- ;;
- mips*-*-linux*)
- LIBPHOBOS_SUPPORTED=yes
-+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
- ;;
- riscv*-*-linux*)
- LIBPHOBOS_SUPPORTED=yes
diff --git a/main/gcc/406-dlang-fix-interface-visibility.patch b/main/gcc/406-dlang-fix-interface-visibility.patch
deleted file mode 100644
index b4d690e015..0000000000
--- a/main/gcc/406-dlang-fix-interface-visibility.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Upstream: Yes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92216 and
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95184
-Reason: GDC produced errors about duplicate symbols when the same interface
-was implemented by two classes in the same project.
-diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
-index 3824060..7afb1aa 100644 (file)
---- a/gcc/d/decl.cc
-+++ b/gcc/d/decl.cc
-@@ -1803,8 +1803,11 @@ make_thunk (FuncDeclaration *decl, int offset)
-
- DECL_CONTEXT (thunk) = d_decl_context (decl);
-
-- /* Thunks inherit the public access of the function they are targetting. */
-- TREE_PUBLIC (thunk) = TREE_PUBLIC (function);
-+ /* Thunks inherit the public access of the function they are targetting.
-+ When the function is outside the current compilation unit however, then the
-+ thunk must be kept private to not conflict. */
-+ TREE_PUBLIC (thunk) = TREE_PUBLIC (function) && !DECL_EXTERNAL (function);
-+
- DECL_EXTERNAL (thunk) = 0;
-
- /* Thunks are always addressable. */
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 64346e09cd..51bb8e47f9 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -1,12 +1,12 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gcc
-pkgver=9.3.0
+pkgver=10.2.0
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname="$pkgname$_target"
-pkgrel=4
+pkgrel=0
pkgdesc="The GNU Compiler Collection"
url="https://gcc.gnu.org"
arch="all"
@@ -150,50 +150,34 @@ fi
makedepends="$makedepends_build $makedepends_host"
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
- 002_all_default-relro.patch
- 003_all_default-fortify-source.patch
- 005_all_default-as-needed.patch
- gcc-as-needed-gold.patch
- 011_all_default-warn-format-security.patch
- 012_all_default-warn-trampolines.patch
- 013_all_default-ssp-fix.patch
- 020_all_msgfmt-libstdc++-link.patch
- 050_all_libiberty-asprintf.patch
- 051_all_libiberty-pic.patch
- 053_all_libitm-no-fortify-source.patch
- 090_all_pr55930-dependency-tracking.patch
- 0003-gcc-poison-system-directories.patch
-
- 203-libgcc_s.patch
- 205-nopie.patch
- 0002-posix_memalign.patch
- 0008-s390x-muslldso.patch
- 0010-ldbl128-config.patch
- 0012-static-pie.patch
-
- libgcc-always-build-gcceh.a.patch
- gcc-4.9-musl-fortify.patch
- gcc-6.1-musl-libssp.patch
- gcc-pure64.patch
- futex-time64.patch
-
- fix-cxxflags-passing.patch
- ada-shared.patch
- ada-musl.patch
- libgnarl-musl.patch
-
- 320-libffi-gnulinux.patch
-
- gcc-pure64-mips.patch
- 0016-invalid_tls_model.patch
-
- 400-dlang-phobos.patch
- 401-dlang-32bits.patch
- 402-dlang-stat.patch
- 403-dlang-ibmz.patch
- 404-dlang-zlib.patch
- 405-dlang-mips.patch
- 406-dlang-fix-interface-visibility.patch
+ 0001-posix_memalign.patch
+ 0002-gcc-poison-system-directories.patch
+ 0003-Turn-on-Wl-z-relro-z-now-by-default.patch
+ 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
+ 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
+ 0006-Enable-Wformat-and-Wformat-security-by-default.patch
+ 0007-Enable-Wtrampolines-by-default.patch
+ 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
+ 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
+ 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
+ 0011-libiberty-copy-PIC-objects-during-build-process.patch
+ 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-fix-fcntl-on-mips-add-libucontext-dep.patch
+ 0018-ada-fix-shared-linking.patch
+ 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
+ 0020-libstdc-futex-add-time64-compatibility.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-Pure-64-bit-MIPS.patch
+ 0025-use-pure-64-bit-configuration-where-appropriate.patch
+ 0026-always-build-libgcc_eh.a.patch
+ 0027-ada-libgnarl-compatibility-for-musl.patch
+ 0028-ada-musl-support-fixes.patch
"
# gcc-4.8-build-args.patch
@@ -624,42 +608,32 @@ gnat() {
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
}
-sha512sums="4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de gcc-9.3.0.tar.xz
-e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch
-f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch
-5e4794d1caddb1050d8935ae5a53ba275b653ad2c9954df89a8c47ac694e6139011829f440eb7e5b24fd57ea25daf25ac83f317871841a78ffb74d167d6f8bf9 005_all_default-as-needed.patch
-6c9a5068f6eea8a85d297a3555b1d2333ffd4b9ddbfb7560a3e643f8577603871ca123373ef7f96e894225291d88f7bf575c7f8386bcfdd1dabcd7ba12598b65 gcc-as-needed-gold.patch
-e026bf9f73ee254528423c6cabdfd7794960c567161581b7d4b7c61c45027e12a6efef79662d4288b9cbaecb4798f01af6a5b4a13b766c2d501444ac1846fd43 011_all_default-warn-format-security.patch
-37de4cc9061bfe1963e6e6570e1a6bbfd58204bf90e0eef819882599a9a80ea28f3eb815c20c1f173dc25d4bd9971b7c7f7f9512d6f8f91f04de1e1175114d4d 012_all_default-warn-trampolines.patch
-38a0fedeac3eebe4a6a957792ba520225cf42663c96a171cd168fdb6c91ffa9a56b80351f8238c5d03b78d3ae2a6539a54481fe4848b4a395e2c87f2ff7adc08 013_all_default-ssp-fix.patch
-d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch
-840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch
-0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch
-e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch
-4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch
-707b30c141778fbcb1e37ebb42873cd7971de232a1298f78bbd834fa74d411b7b49cecfe4f247316d7c785da792f95f26ea6d824cd322a8f87b29537af3f77f3 0003-gcc-poison-system-directories.patch
-d1c2d7ff7f673375dc7cd84ae9d8515853b5af6390c70bb763412c012101344e4ee1ce155151ce3fb6ba2b80af7ed42d697dbe1bf6fd6e7b2b9087a378c47c37 203-libgcc_s.patch
-98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch
-6d84354e6df96d5ea244eb3bb5f044781796b88040b11c78fb6ee509e5aac19d46e0e92ca836e98e6495d9751f52439833b748efc419e4f5d5301fb549c4dcc9 0002-posix_memalign.patch
-7f434a7350c9b06d0ae7cc18a569d813238483afa34b0801d112844a0dfe6164ae36b0416955fd4da7a8caa54672247f319a8ec7ce4b6a97a5f4e17ec083112a 0008-s390x-muslldso.patch
-66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch
-d91c5eba37166cf34ca38e03808e3960c091b3627008a0c68c127cdf52e3827f8cfbe478ababe64c3cbb4d5eb8ed6230a21a74b6908549e05e08646de09df37c 0012-static-pie.patch
-d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
-600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
-dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
-fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch
-5b12af738349a22346589e53e7ab7d37a065b7f4c756aab4c1cc1b4753cdf9ad1bf198f4e4783ae10232df63da0855591bab2452b50ac96a08905972d93c1b0e futex-time64.patch
-35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
-3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch
-cceeac95f47ea8664e1c16c5ebecb472b5aaa56040e943c1b97c7873b50e3a2bf972d9f743d342a2444a3bb711a0720d2446fded43892c5e05bdeefd478b0cd1 ada-musl.patch
-a1f7750bc7b8b7d916a5dee34fcc736bd4fb249c96538b547d495794e6cfd49356aa3974506a15074b4cb58edd5d7e2868607c902dd003e8c464d5066fd4a575 libgnarl-musl.patch
-f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch
-86be3338cc9c33089608bc4c5e3b7918c4e500a345c338f361b18c342119a6ed69af5495d72950de7106d760f003528b46ad14795e805f8a3331e206dcb234e3 gcc-pure64-mips.patch
-17e0faeef742d32d57a070d983480367dd28cd28d47a8966ce327afdff3a38ea76803a833c90aff7d3a93aa66dae76c9be47b2408500913b40571af25b85aca7 0016-invalid_tls_model.patch
-38772c5b0905455a44c43d6ef7e5f140530006e2bde9f5ffd6b569c7cf9633992515f666b486d7a78c30ab8da99b92b2775c90fde47821ae542ef1c49dc405df 400-dlang-phobos.patch
-84bdbdfcb972161765b81220ea2e80e83c32f3ab27596b77eb451d8cac4bd6312210df468581c2b0e1363f5e3b31654e369c47ae84c907f3b54a1786d7c17830 401-dlang-32bits.patch
-9d73f21eaa2458d28a144dd0e5478ed52763a4d8bbf62084b607db52bce1e2242f773c853fc34e6aae2d53c4124948139954627064e850e9dabaddaef5cb9d69 402-dlang-stat.patch
-fd056014d0c6f627108d7387bfe46b5fb66786a16fa964da55b0442658b1c8e9e903c641a9e3233000ef37691e32ea4fef22029ab5eba217ccbc8bd5941e81ae 403-dlang-ibmz.patch
-ddb3ca26b5e55f6d376036c2ed87959770bfb72d1175d0dba332f705edf6817806d53765c838ff670472a16ab175bd1ce88946c19d83f9d5e53ff2b4d3558dfb 404-dlang-zlib.patch
-3f40f796f50d49ea0a185d3454c79606fb5f90ed48c030fe25c1df8c4a72ba7cae37dccdb260cf737beb3e921dc2ddad68effbe446dbf220a07d0158b9b9ca8d 405-dlang-mips.patch
-c226bb5c60ae5071549e5ec3ab44dc87b244615ba520973b1d4c50a2b6d3fd941c4e5e8e1f85cad28093ee8627d20415114524b593ad3a9b24998328d3f3ea72 406-dlang-fix-interface-visibility.patch"
+sha512sums="42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e gcc-10.2.0.tar.xz
+5edc2dfe8e5d680c8c622b16943a1ec4e7f7db245e2fa4e54371962c048af1f074b1ed49f619f8abdf0eb97129d8b7198b4f16f06da794fe0fd6ce4d55f829fb 0001-posix_memalign.patch
+bff1c9a08d32186b94660c42823babd63729b2a050e761c514c3f23c7eac2585ddc4f748df547915fb6b2fc098f3ecc2e8d9707f3aef9bb9c6103ba92ed5f906 0002-gcc-poison-system-directories.patch
+7662cc8c6cd77a6cacb2899f4fb13d14495feb508bad9ee8ae0dd38ecddf8d45391ec636022913eece41661fbd5d336ac2130a5c08b2495eb5aff5501cff49a6 0003-Turn-on-Wl-z-relro-z-now-by-default.patch
+26303e588f37c4208c3da962972b83759daa5abaf8eaf4da331a4cf1e3a90590ad56a7f8b766795bda7b6baa69aaa9c09864f297d376feacbe4ba08249da2d8d 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
+4be2f8ab07e5ff2b018c633e057927446259b63cc65229f977c84b294820d1dbecc29c2e6167b3cb000a5995e7def64cd8191031ee2b2c2ec3e5b4ad70267083 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
+e97e619874c0edb60d826669426f96b6f09b79849538415ee1a205345a574ea292de5f324925dd1c821859a3c4873a2392e11edcd6ac6b53f6d6d389b25ffe94 0006-Enable-Wformat-and-Wformat-security-by-default.patch
+c3081e7b37dcb2e2b4381e6fcc2abfa066bb4adc3ad4bdd7bd1402a6a3ccc354bfcf713c6acb379001dd97e14e6bdc8eb2eeca6b1e45262bea3262d51394c0e6 0007-Enable-Wtrampolines-by-default.patch
+cc602c71b0893b058021cd45d239c3e9f013f68cd56f642fcdad342456bae9ea08ddf0929a6c2e6e452987d1d8c4be97dfe0314d9107e01bf6403ce97e83a30f 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
+0bc96d3a2afd0499e01b47a8197f9a5ead04219d0674f0dea97a4654def7dca2c50d8c005d04558212d53e4ec9fcf2bf4a3286d7a12b24eba0134aa1197abfe1 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
+2662eadcc54408f5c6596e24615a6771c046575a53b8aec65677fcaa699446021b8f3360efc7660d72bf004bffd98f9d4f9d64eba97dedcbb752bb3fffc5a048 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
+0003e594bbbf142d678f0f79fc03ff467276331a8c87016ecd5f9683abb14aea2550e6880995dd160dc92a3e4ec04e4b2323eda403d4fa8453c258c28bcc969e 0011-libiberty-copy-PIC-objects-during-build-process.patch
+209f7cfb281c3c10af2b84e1542e9093bb0fb36171c7d12ce33b1d92a70388d0aae7b1bb22a613a59e352de62927a0f8e9d3a0b4729c12f8eebacc74d29ecfdd 0012-libitm-disable-FORTIFY.patch
+e72ad6130dd5dd64ef34ff9f07cf23d310d0d530b272fa1bdc9459991dfb10eec64af3249f213d7f4393024d7d5111890f74679e1029ee0e97b1b6c12a708296 0013-libgcc_s.patch
+16fa64460806a6456c8185cf703e7afdf87f55cf49256ed06fd1c098d97d69a3d1df715bb409984ebd275009495ac9ee01bc090580558d2ff569fa2dbbff5fa6 0014-nopie.patch
+e054c819446d58e119570cca88a23f541c215c8e4a6eb65d194b97610046593981aaa306d74d39ad6868cb2a85da510dedefd0b729804e3b88a518e4a0897d20 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch
+1b70eae1dfb7b819555c51c51d88b9acd09f44d491bf09b265bed7027721c3a74628715fd1bbc537ba43071e98e6747e08ad117b78fedda19571d7a8f6e2c9db 0016-dlang-update-zlib-binding.patch
+9f4cf47a2f4016cb6808f245159d9365134963765af41654d60c2f62d4622405f1d1041c3690d50a2db9501075ccc932efd32c739bb0d241af5b80829cb8bafe 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
+55ca9cc19376ac4ce333abdee700e185811455419da80b0f6d765d079aa1344073d09883add920530ad62a3b9c01c347f634931f3735cb021b81b8fd7229467c 0018-ada-fix-shared-linking.patch
+b461122d5bc5778398c72bc02bef6ee344ba6c79b7ff9945f9d252559ad445b298e154d7c4784e22fc5cf9d299fc3a8cfc3c0e4d37f12b961148e0432ac4e434 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
+61fdf02497bc5d90bdc1c9b2aa0294bbe1ab4285940dc840d94bda00b0c4dec342df639b11721e5569a6de47e53099928f1f1fb07ddcf3466535e8092b2af9a7 0020-libstdc-futex-add-time64-compatibility.patch
+b40fb4f96693a7a0cec086c24f17ba5c8c416e67d76d468306b26895033ee326454a2b2d3028077b9f2187c545bff8c99e87d44298c179ccbc1f48f04ccc0889 0021-add-fortify-headers-paths.patch
+7a7414d44a43260d7098bf24dacea6595fdaf42496ef1d176bb7a254da813c1faaf1ecfa6e1463af34c466f02cf2f8489dbfeae9bbfb070726d27da0330e4c59 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
+7bd3b297a05df00a0c961c407d84c60b7dcf5150919a6ce8e6d5162bb82e5820ae938feec24dad62dca141b4ede302345b6e08e21f06dd9393bec7592a8aecf7 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
+5c61dac5100dce45ad17f45e5e63e3f1e46173639384d7fb3c343e0b6a1e4c0ab39491d397c4445be63cf182f3bb79f7995cc8f89f70a61321dea24bf29cdd18 0024-Pure-64-bit-MIPS.patch
+be8eee9edfe4e768ea4873b618a3431ae4502e933af343f80b623e38626c0e9187b73debd6773ae8dfbfb514ff0e4a18a5102e5fac4545e5de18f8e226e6b237 0025-use-pure-64-bit-configuration-where-appropriate.patch
+2a2c89b3dfac37344bc17fbb9471b903cbdf4332c71bb20942587acccf962a42d58d2535cc0d90a0f6cddc8f6db1328c6b9f158aecbff99a92f9fa0e0683c0a7 0026-always-build-libgcc_eh.a.patch
+739e9d58875c291af82ca9d7509f52679a01704beb4f003e3ace1cd1ae2aede5763243e34c2c73be13bd1dd46539f50d3b7c7a293686b0c6158d3069d377009e 0027-ada-libgnarl-compatibility-for-musl.patch
+69f330f91a3354753e9283e804f18257c3e7a51f368defe4a704d20c2a00fd6d6cb62f4d7931ca886dd7dffeaf59fa9beaf36c19ebd3d25cdebfefc884d64c02 0028-ada-musl-support-fixes.patch"
diff --git a/main/gcc/fix-cxxflags-passing.patch b/main/gcc/fix-cxxflags-passing.patch
deleted file mode 100644
index 8eb1de77d5..0000000000
--- a/main/gcc/fix-cxxflags-passing.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- gcc-4.8.1/Makefile.in.orig
-+++ gcc-4.8.1/Makefile.in
-@@ -169,6 +169,7 @@
- # built for the build system to override those in BASE_FLAGS_TO_PASSS.
- EXTRA_BUILD_FLAGS = \
- CFLAGS="$(CFLAGS_FOR_BUILD)" \
-+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
- LDFLAGS="$(LDFLAGS_FOR_BUILD)"
-
- # This is the list of directories to built for the host system.
diff --git a/main/gcc/futex-time64.patch b/main/gcc/futex-time64.patch
deleted file mode 100644
index b02c1ff2b4..0000000000
--- a/main/gcc/futex-time64.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-needed for musl 1.2 and time64.
-Upstream bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93421
-
---- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500
-+++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500
-@@ -61,7 +61,15 @@
- struct timeval tv;
- gettimeofday (&tv, NULL);
- // Convert the absolute timeout value to a relative timeout
-+#if defined(SYS_futex_time64)
-+ struct
-+ {
-+ long tv_sec;
-+ long tv_nsec;
-+ } rt;
-+#else
- struct timespec rt;
-+#endif
- rt.tv_sec = __s.count() - tv.tv_sec;
- rt.tv_nsec = __ns.count() - tv.tv_usec * 1000;
- if (rt.tv_nsec < 0)
diff --git a/main/gcc/gcc-4.9-musl-fortify.patch b/main/gcc/gcc-4.9-musl-fortify.patch
deleted file mode 100644
index daae954c80..0000000000
--- a/main/gcc/gcc-4.9-musl-fortify.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000
-+++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000
-@@ -146,6 +146,8 @@
-
- #ifdef NATIVE_SYSTEM_HEADER_DIR
- #define INCLUDE_DEFAULTS_MUSL_NATIVE \
-+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \
-+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \
- { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
- { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
- #else
diff --git a/main/gcc/gcc-6.1-musl-libssp.patch b/main/gcc/gcc-6.1-musl-libssp.patch
deleted file mode 100644
index fe5c61434d..0000000000
--- a/main/gcc/gcc-6.1-musl-libssp.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Author: Timo Teräs <timo.teras@iki.fi>
-
-Alpine musl package provides libssp_nonshared.a. We link to it unconditionally,
-as otherwise we get link failures if some objects are -fstack-protector built
-and final link happens with -fno-stack-protector. This seems to be the common
-case when bootstrapping gcc, the piepatches do not seem to fully fix the
-crosstoolchain and bootstrap sequence wrt. stack-protector flag usage.
-
---- gcc-6.1.0/gcc/gcc.c.orig
-+++ gcc-6.1.0/gcc/gcc.c
-@@ -870,8 +870,7 @@
-
- #ifndef LINK_SSP_SPEC
- #ifdef TARGET_LIBC_PROVIDES_SSP
--#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
-- "|fstack-protector-strong|fstack-protector-explicit:}"
-+#define LINK_SSP_SPEC "-lssp_nonshared"
- #else
- #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
- "|fstack-protector-strong|fstack-protector-explicit" \