cross/gcc-*: upgrade to 13.1.1_git20230513-r1

This commit is contained in:
Newbyte 2023-05-15 10:15:31 +02:00
parent a3001a0cb0
commit 57b22658a9
No known key found for this signature in database
GPG key ID: 990600ED1DB95E02
192 changed files with 1836 additions and 5748 deletions

View file

@ -1,14 +1,14 @@
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
From a695388351636049500bd1f014caed177c2123c3 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
Subject: [PATCH 01/33] 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 3b2e4f47915..20f790904a2 100644
index 3527283693b..c4071b64b53 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@ -37,3 +37,6 @@ index 3b2e4f47915..20f790904a2 100644
return __ptr;
else
return NULL;
--
2.40.1

View file

@ -1,7 +1,7 @@
From dd1e75ff4ecda96957465b34681f245e818928bd Mon Sep 17 00:00:00 2001
From 41a1d0593acc2b24fb57bfec98a4328342b616da Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH] gcc: poison-system-directories
Subject: [PATCH 02/33] 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
@ -26,10 +26,10 @@ Upstream-Status: Pending
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 8a0dafc522d..0357868e22c 100644
index 862c474d3c8..64c4277c991 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -710,6 +710,10 @@ Wreturn-local-addr
@@ -711,6 +711,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
@ -41,10 +41,10 @@ index 8a0dafc522d..0357868e22c 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 64c27c9cfac..f0fbf123aa8 100644
index 4cad077bfbe..0679fbbf4c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -230,6 +230,12 @@
@@ -236,6 +236,12 @@
#endif
@ -58,10 +58,10 @@ index 64c27c9cfac..f0fbf123aa8 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 5ce0557719a..e9060112384 100755
index c7b26d1927d..8c46369f73f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@ -69,7 +69,7 @@ index 5ce0557719a..e9060112384 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1785,6 +1786,8 @@ Optional Features:
@@ -1788,6 +1789,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@ -78,7 +78,7 @@ index 5ce0557719a..e9060112384 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@ -99,10 +99,10 @@ index 5ce0557719a..e9060112384 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..75a7048045c 100644
index 09082e8ccae..5504bf6eb01 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@ -120,37 +120,37 @@ index 23bee7010a3..75a7048045c 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 07b440190c3..b2de464798a 100644
index 36ed1591440..4ff3e817c23 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -8029,6 +8030,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
-Wparentheses -Wno-pedantic-ms-format
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
+-Wno-poison-system-directories
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
-Wrestrict -Wno-return-local-addr -Wreturn-type
-Wno-scalar-storage-order -Wsequence-point
@@ -8423,6 +8424,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.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+@item -Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
@item -Wfloat-equal
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..47fb5802194 100644
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
@@ -1146,6 +1146,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}}} \
@ -160,7 +160,7 @@ index bb07cc244e3..47fb5802194 100644
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
@ -198,3 +198,6 @@ index bd2a97938eb..c80f100f476 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.40.1

View file

@ -1,7 +1,7 @@
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
From a15c0e1514fb5fa5609ad7abc6c5f5d0749d0c4a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
Subject: [PATCH 03/33] specs: turn on -Wl,-z,now by default
Previously, we also used to turn on -z relro here, but we now build
binutils with --enable-relro, which is functionally equivalent.
@ -14,24 +14,24 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b2de464798a..83bd1bde433 100644
index 4ff3e817c23..b1877a751aa 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -17958,6 +17958,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,now} is used. To disable, use @option{-Wl,-z,nonow}.
+
@item -u @var{symbol}
@opindex u
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 47fb5802194..d18b5d7b59a 100644
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
@ -39,3 +39,6 @@ index 47fb5802194..d18b5d7b59a 100644
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.40.1

View file

@ -1,8 +1,8 @@
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
From edb757265420be9c5a903827bedf46b02c09d868 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0
Subject: [PATCH 04/33] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
ObjC, ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.cc | 4 ++++
@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
index 98f5aef2af9..d4da19e4014 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1545,6 +1545,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
@ -25,10 +25,10 @@ index 4672ae8486a..573c021e1e8 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 83bd1bde433..dda299a9987 100644
index b1877a751aa..91d384e1927 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
@@ -11865,6 +11865,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.
@ -38,6 +38,9 @@ index 83bd1bde433..dda299a9987 100644
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.40.1

View file

@ -1,8 +1,8 @@
From 75d1a35180cf0967f062765314bf091a64032062 Mon Sep 17 00:00:00 2001
From dda9ee88db09aadab7585fa33aca67f1702df190 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
but always link the sanitizer libraries with --no-as-needed.
Subject: [PATCH 05/33] On linux targets pass --as-needed by default to the
linker, but always link the sanitizer libraries with --no-as-needed.
---
gcc/config/aarch64/aarch64-linux.h | 1 +
@ -22,7 +22,7 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 5e4553d79f5..b516f3ef97f 100644
index 4277f03da2a..b131983a546 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@ -34,7 +34,7 @@ index 5e4553d79f5..b516f3ef97f 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 17f16a55910..9ec667e9a5e 100644
index 03f783f2ad1..d946e700dda 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
@ -47,7 +47,7 @@ index 17f16a55910..9ec667e9a5e 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index df3da67c4f0..7532bc29f9b 100644
index 7b7b7cbbe14..49c050c6f2c 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@ -59,7 +59,7 @@ index df3da67c4f0..7532bc29f9b 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 857c0e077bf..8433e56c3e1 100644
index eda8010b133..b26b17f2f2a 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -69,9 +69,9 @@ index 857c0e077bf..8433e56c3e1 100644
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBHWASAN_EARLY_SPEC
#define LIBHWASAN_EARLY_SPEC "%{static-libhwasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
"%{static-libhwasan:%{!shared:" \
@@ -146,12 +146,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
@ -87,7 +87,7 @@ index 857c0e077bf..8433e56c3e1 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index 0102b2a6f3b..994414c1845 100644
index a79b739089d..e0752673dff 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
@ -100,7 +100,7 @@ index 0102b2a6f3b..994414c1845 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index abc8cf624ca..fe656aeae27 100644
index 3b63b99acf6..759bf0db86f 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -112,7 +112,7 @@ index abc8cf624ca..fe656aeae27 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 93510098ccc..3813e536423 100644
index 5dfd428aa17..02656dad7fc 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@ -125,7 +125,7 @@ index 93510098ccc..3813e536423 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index 6aad7192e69..e1256a55add 100644
index a4e5380b589..3cc61bce69f 100644
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
@ -137,7 +137,7 @@ index 6aad7192e69..e1256a55add 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 38803723ba9..3067ed6eac8 100644
index b9557a75dc7..d8d1450f346 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
@ -149,7 +149,7 @@ index 38803723ba9..3067ed6eac8 100644
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index b2a7afabc73..34ceb4e4fce 100644
index 9e457033d11..08016bf224d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -377,13 +377,13 @@ extern int dot_symbols;
@ -169,10 +169,10 @@ index b2a7afabc73..34ceb4e4fce 100644
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 7e2519de5d4..61215a7a1b3 100644
index ae932fc22f0..c8ff0c6dc8e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@ -182,7 +182,7 @@ index 7e2519de5d4..61215a7a1b3 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index d7b7e7a7b02..d2287f14f2e 100644
index 02aa1edaff8..64df5801134 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
@ -195,7 +195,7 @@ index d7b7e7a7b02..d2287f14f2e 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 6a809e9092d..93bfb92d3ff 100644
index 0e33b3cac2c..c2f44546e62 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@ -208,10 +208,10 @@ index 6a809e9092d..93bfb92d3ff 100644
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d18b5d7b59a..3b76311b544 100644
index f82fae23c22..da6417dd0d1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -744,8 +744,11 @@ proper position among the other output files. */
@@ -754,8 +754,11 @@ proper position among the other output files. */
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -225,7 +225,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -780,8 +783,11 @@ proper position among the other output files. */
@@ -790,8 +793,11 @@ proper position among the other output files. */
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -239,7 +239,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -798,8 +804,11 @@ proper position among the other output files. */
@@ -808,8 +814,11 @@ proper position among the other output files. */
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -253,7 +253,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -814,8 +823,11 @@ proper position among the other output files. */
@@ -824,8 +833,11 @@ proper position among the other output files. */
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
@ -267,3 +267,6 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.40.1

View file

@ -1,17 +1,17 @@
From c664283dd30949c5299d1c45bd5740bcfe993d22 Mon Sep 17 00:00:00 2001
From 14d66aece585329970ed8a777792502baaa9606b Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
Subject: [PATCH 06/33] Enable -Wformat and -Wformat-security by default.
---
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 07da40ef43b..8683f706426 100644
index a75038930ae..b98726f33ed 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
@@ -704,7 +704,7 @@ Warn about function calls with format strings that write past the end
of the destination region. Same as -Wformat-overflow=1.
Wformat-security
@ -20,7 +20,7 @@ index 07da40ef43b..8683f706426 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@ -29,3 +29,6 @@ index 07da40ef43b..8683f706426 100644
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.40.1

View file

@ -1,17 +1,17 @@
From e4d0ec43e772b6dc7c3708aed5309897df26a125 Mon Sep 17 00:00:00 2001
From 53bedd7a7bfcc70cd518afedbf3713cbfaa1e631 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.
Subject: [PATCH 07/33] 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 0357868e22c..6d5e5eebe60 100644
index 64c4277c991..c24839d32bc 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@ -20,3 +20,6 @@ index 0357868e22c..6d5e5eebe60 100644
Warn whenever a trampoline is generated.
Wtrivial-auto-var-init
--
2.40.1

View file

@ -1,8 +1,8 @@
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b Mon Sep 17 00:00:00 2001
From d5cecc5d699ad150c38794c6f4f231fa48cb450d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
Change the buffer size.
Subject: [PATCH 08/33] Disable ssp on -nostdlib, -nodefaultlibs and
-ffreestanding Change the buffer size.
---
gcc/gcc.cc | 8 +++++++-
@ -10,10 +10,10 @@ Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 3b76311b544..cc99d0b7aa1 100644
index da6417dd0d1..b5a6f200635 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -996,6 +996,12 @@ proper position among the other output files. */
@@ -983,6 +983,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@ -26,7 +26,7 @@ index 3b76311b544..cc99d0b7aa1 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
@ -36,10 +36,10 @@ index 3b76311b544..cc99d0b7aa1 100644
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index b88e1372005..82a7e25dd2f 100644
index 823cdb2ff85..5b096899b40 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -1006,7 +1006,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value.
-param=ssp-buffer-size=
@ -48,3 +48,6 @@ index b88e1372005..82a7e25dd2f 100644
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.40.1

View file

@ -1,8 +1,8 @@
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 Mon Sep 17 00:00:00 2001
From a646f903a6c04393c4c013d7bc4c979a74a0e0f9 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
bootstrapping.
Subject: [PATCH 09/33] Ensure that msgfmt doesn't encounter problems during
gcc bootstrapping.
Solves error messages like the following:
@ -26,7 +26,7 @@ https://bugs.gentoo.org/295480
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index 8f51544989e..5329804d136 100644
index 12d34910830..61b13762b71 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@ -38,7 +38,7 @@ index 8f51544989e..5329804d136 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 243f3db7b72..822210781fa 100644
index 8e93445acd2..d6ff06e5ddb 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -561,6 +561,7 @@ uninstall-am:
@ -49,3 +49,6 @@ index 243f3db7b72..822210781fa 100644
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.40.1

View file

@ -1,14 +1,14 @@
From 190064993cd8ddbd48015c1fc1916e4110a97733 Mon Sep 17 00:00:00 2001
From 7a5b7b5c556b410074af850c6c49eb5e6ba84362 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH] Don't declare asprintf if defined as a macro.
Subject: [PATCH 10/33] 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 a65ced9c820..eb20ab0f95f 100644
index 1d5c779fcff..19e3cb1e31c 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@ -23,3 +23,6 @@ index a65ced9c820..eb20ab0f95f 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.40.1

View file

@ -1,14 +1,14 @@
From 838e1daa955d9013c462be3471497cb39641e951 Mon Sep 17 00:00:00 2001
From b51bd406029737efbe4c93f8dbbaf797c4979215 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH] libiberty: copy PIC objects during build process
Subject: [PATCH 11/33] 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 1b17c2e3a47..8db1176df2e 100644
index 72608f3e4a7..58356884728 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@ -19,3 +19,6 @@ index 1b17c2e3a47..8db1176df2e 100644
cd ..; \
else true; fi
--
2.40.1

View file

@ -1,7 +1,7 @@
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b Mon Sep 17 00:00:00 2001
From 5c0678a73c11e16853632717ced113497878b1b0 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH] libgcc_s
Subject: [PATCH 12/33] libgcc_s
---
gcc/config/i386/i386-expand.cc | 4 ++--
@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 31780b6daf7..d89898846e1 100644
index 0d817fc3f3b..2e99db00db9 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
@@ -12691,10 +12691,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@ -27,7 +27,7 @@ index 31780b6daf7..d89898846e1 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 dab1d98060f..cf824b4114a 100644
index 50b6d8248a2..724ced402a1 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
@ -52,3 +52,6 @@ index 8506a635790..564296f788e 100644
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.40.1

View file

@ -1,30 +0,0 @@
From 717346fbbd6642ba6b0c3af2deb3771794346507 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:36 +0000
Subject: [PATCH] libitm: disable FORTIFY
---
libitm/configure.tgt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index 06e90973ef3..669e64236c3 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -47,6 +47,16 @@ if test "$gcc_cv_have_tls" = yes ; then
esac
fi
+# FIXME: error: inlining failed in call to always_inline
+# int vfprintf(FILE*, const char*, __va_list_tag*)
+# : function body can be overwritten at link time
+# Disable Fortify in libitm for now. #508852
+case "${target}" in
+ *-*-linux*)
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
+ ;;
+esac
+
# 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

View file

@ -1,7 +1,7 @@
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c Mon Sep 17 00:00:00 2001
From 242ee89090db9c1ad797d949fc99819dcacf2e98 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH] nopie
Subject: [PATCH 13/33] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
@ -9,10 +9,10 @@ Subject: [PATCH] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index e9060112384..2f6b3265a6c 100755
index 8c46369f73f..e59cbee1767 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32497,6 +32497,33 @@ fi
@@ -32268,6 +32268,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 e9060112384..2f6b3265a6c 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 75a7048045c..e683d3a7a5f 100644
index 5504bf6eb01..57268319de1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
@@ -7552,6 +7552,19 @@ AC_CACHE_CHECK([for -no-pie option],
LDFLAGS="$saved_LDFLAGS"])
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@ -70,3 +70,6 @@ index 75a7048045c..e683d3a7a5f 100644
fi
AC_SUBST([NO_PIE_FLAG])
--
2.40.1

View file

@ -1,14 +1,14 @@
From fd642f8cd61849a9dc169588be5562ceda96a889 Mon Sep 17 00:00:00 2001
From 0e273647111ae365ac5c27dee96dc18f69668eac Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH] ada: fix shared linking
Subject: [PATCH 14/33] 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 a7574efb472..0ad0d66463c 100644
index f2126441208..22cfa9c641f 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
@ -37,3 +37,6 @@ index a7574efb472..0ad0d66463c 100644
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.40.1

View file

@ -1,17 +1,17 @@
From a547632f5c7caec4a164e8d5e5b568fb7a461365 Mon Sep 17 00:00:00 2001
From 3163941fdbb16261c4617fc6a1711d0835378d16 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
Subject: [PATCH 15/33] build: fix CXXFLAGS_FOR_BUILD passing
---
Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 593495e1650..b96f60e33e2 100644
index 06a9398e172..6ff2b3f9925 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
@@ -178,6 +178,7 @@ BUILD_EXPORTS = \
# built for the build system to override those in BASE_FLAGS_TO_PASS.
EXTRA_BUILD_FLAGS = \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
@ -19,3 +19,6 @@ index 593495e1650..b96f60e33e2 100644
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
--
2.40.1

View file

@ -1,21 +0,0 @@
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:18:32 +0000
Subject: [PATCH] dlang: use libucontext on mips64
---
libphobos/configure.tgt | 1 +
1 file changed, 1 insertion(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 0063dd23249..c5e782a1238 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes

View file

@ -1,17 +1,17 @@
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d Mon Sep 17 00:00:00 2001
From 157c80f27b5a9404c8f86e016d590ef7b691bc70 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths
Subject: [PATCH 16/33] 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 74f70793d90..61b07f319f6 100644
index e3aca79cccc..b3537b8fbeb 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
@ -20,3 +20,6 @@ index 74f70793d90..61b07f319f6 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.40.1

View file

@ -1,9 +1,9 @@
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 Mon Sep 17 00:00:00 2001
From da159d71a8f2844a653fd5cdb320aeeed99aadd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Aug 2020 07:03:00 +0000
Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
it unconditionally, as otherwise we get link failures if some objects are
-fstack-protector built and final link happens with -fno-stack-protector.
Subject: [PATCH 17/33] 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.
@ -13,10 +13,10 @@ Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index cc99d0b7aa1..c60a75371f8 100644
index b5a6f200635..6cbb726599b 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
@@ -991,8 +991,7 @@ proper position among the other output files. */
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
@ -26,3 +26,6 @@ index cc99d0b7aa1..c60a75371f8 100644
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.40.1

View file

@ -1,7 +1,7 @@
From bbd5c529ef878c2d6096fd4949616714eb82683a Mon Sep 17 00:00:00 2001
From 78e41f066281892aa353cf2df61d1dc9e60af23a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
Subject: [PATCH 18/33] DP: Use --push-state/--pop-state for gold as well when
linking libtsan.
---
@ -9,10 +9,10 @@ Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c60a75371f8..735b2b1bba1 100644
index 6cbb726599b..59390fd39d6 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -745,10 +745,10 @@ proper position among the other output files. */
@@ -755,10 +755,10 @@ proper position among the other output files. */
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
@ -25,7 +25,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -784,10 +784,10 @@ proper position among the other output files. */
@@ -794,10 +794,10 @@ proper position among the other output files. */
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
@ -38,7 +38,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -805,10 +805,10 @@ proper position among the other output files. */
@@ -815,10 +815,10 @@ proper position among the other output files. */
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
@ -51,7 +51,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -824,10 +824,10 @@ proper position among the other output files. */
@@ -834,10 +834,10 @@ proper position among the other output files. */
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
@ -64,3 +64,6 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.40.1

View file

@ -1,7 +1,7 @@
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b Mon Sep 17 00:00:00 2001
From 59e1be27072008d0c42e0315332a8bdcf7cdaefc Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:12:55 +0000
Subject: [PATCH] aarch64: disable multilib support
Subject: [PATCH 19/33] aarch64: disable multilib support
multilib is unsupported on Alpine GCC
---
@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
index d0cd546002a..b63a77f4969 100644
index 57bf4100fcd..172894b57ef 100644
--- a/gcc/config/aarch64/t-aarch64-linux
+++ b/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
@ -21,3 +21,6 @@ index d0cd546002a..b63a77f4969 100644
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.40.1

View file

@ -1,7 +1,7 @@
From 65ad898df141261a1ccd891a99133ad8f9847133 Mon Sep 17 00:00:00 2001
From a03f39ffea2bc204beaef1f0dfb8bab41efeb49f Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:13:59 +0000
Subject: [PATCH] s390x: disable multilib support
Subject: [PATCH 20/33] s390x: disable multilib support
multilib is not supported on Alpine GCC at present
---
@ -20,3 +20,6 @@ index cc6ab367072..7f498ee1cdc 100644
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.40.1

View file

@ -1,45 +0,0 @@
From 714ed6d9649bf9ed42e34fef9c41169921e63921 Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] mips64: disable multilib support
multilib is not supported by Alpine GCC
---
gcc/config/mips/mips.h | 8 ++++----
gcc/config/mips/t-linux64 | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 858bbba3a36..2d4f553e652 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3447,11 +3447,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#elif MIPS_ABI_DEFAULT == ABI_64
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
/* 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 2fdd8e00407..406a3676289 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib \
+ ../lib32 \
+ ../lib

View file

@ -1,7 +1,7 @@
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be Mon Sep 17 00:00:00 2001
From fceb9cfebae070da1b07c5dbc915d2ea128bfb7d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:33 +0000
Subject: [PATCH] ppc64[le]: disable multilib support
Subject: [PATCH 21/33] ppc64[le]: disable multilib support
multilib is not presently supported on Alpine GCC
---
@ -36,7 +36,7 @@ index 4e371255533..128c75c7d39 100644
endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index 47e0efd5764..f89729af64f 100644
index 01a94242308..b3a76379c03 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
@ -76,3 +76,6 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.40.1

View file

@ -1,7 +1,7 @@
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 Mon Sep 17 00:00:00 2001
From f79c1c2b5634ac59e120bc1130ba5584e7120623 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:54 +0000
Subject: [PATCH] x86_64: disable multilib support
Subject: [PATCH 22/33] x86_64: disable multilib support
multilib is not presently supported on Alpine GCC
---
@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index 5526ad0e6cc..78866afab36 100644
index 138956b0962..bc03dab874f 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -33,6 +33,6 @@
@ -21,3 +21,6 @@ index 5526ad0e6cc..78866afab36 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.40.1

View file

@ -1,7 +1,7 @@
From 2eed19787020ce52cf07b76a5d167c420ec42b61 Mon Sep 17 00:00:00 2001
From f1fb56b945fc7fc649d78a2f73bfe98f1377c814 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 3 Jan 2022 07:14:48 +0100
Subject: [PATCH] riscv: disable multilib support
Subject: [PATCH 23/33] riscv: disable multilib support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -43,7 +43,7 @@ library.
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3067ed6eac8..4c8c85e3285 100644
index d8d1450f346..a386bba87d7 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
@ -69,3 +69,6 @@ index 216d2776a18..1a8a863853e 100644
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.40.1

View file

@ -1,7 +1,7 @@
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a Mon Sep 17 00:00:00 2001
From b3d43777021f3c61def29d3764e8ee05ebb3c520 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:05:41 +0000
Subject: [PATCH] always build libgcc_eh.a
Subject: [PATCH 24/33] always build libgcc_eh.a
highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
@ -10,10 +10,10 @@ highly inspired by:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 09b3ec8bc2e..c9ca58c64cc 100644
index 6c4dc79ab71..023cede18a7 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
@@ -960,8 +960,9 @@ ifneq ($(LIBUNWIND),)
all: libunwind.a
endif
@ -24,7 +24,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
@@ -1160,10 +1161,6 @@ install-libunwind:
@@ -1163,10 +1164,6 @@ install-libunwind:
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
@ -35,7 +35,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
@@ -1180,6 +1177,10 @@ ifeq ($(enable_gcov),yes)
@@ -1183,6 +1180,10 @@ ifeq ($(enable_gcov),yes)
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
endif
@ -46,3 +46,6 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.40.1

View file

@ -1,7 +1,7 @@
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 Mon Sep 17 00:00:00 2001
From c33ad45cabb27512ec7f4e8f7e40cf448f4db59d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:06:30 +0000
Subject: [PATCH] ada: libgnarl compatibility for musl
Subject: [PATCH 25/33] ada: libgnarl compatibility for musl
---
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
@ -9,7 +9,7 @@ Subject: [PATCH] ada: libgnarl compatibility for musl
2 files changed, 3 insertions(+), 61 deletions(-)
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
index 7c9e7ca4518..caafc4aa68f 100644
index a5e645d334d..32165347071 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -403,12 +403,6 @@ package System.OS_Interface is
@ -38,7 +38,7 @@ index 7c9e7ca4518..caafc4aa68f 100644
sched_priority : int; -- scheduling priority
end record;
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 4ff784f0ea7..b34a12802c6 100644
index 821ceef30e4..ae95b58e01e 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
@ -130,3 +130,6 @@ index 4ff784f0ea7..b34a12802c6 100644
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
--
2.40.1

View file

@ -1,7 +1,7 @@
From 82addb1312f4f58a412a664228944009aa5cb569 Mon Sep 17 00:00:00 2001
From 3169e4c52c248f21a084ef5b540201c982e61d35 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH] ada: musl support fixes
Subject: [PATCH 26/33] ada: musl support fixes
---
gcc/ada/Makefile.rtl | 10 +++++-----
@ -11,10 +11,10 @@ Subject: [PATCH] ada: musl support fixes
4 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index aaf853e3a2a..e2dd3587ed5 100644
index 96306f8cc9a..090b6770ae5 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1633,7 +1633,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@@ -1549,7 +1549,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -23,7 +23,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2258,7 +2258,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2174,7 +2174,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -32,7 +32,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2289,7 +2289,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@ -41,7 +41,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2504,7 +2504,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2420,7 +2420,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -50,7 +50,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2608,7 +2608,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2524,7 +2524,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) \
@ -58,9 +58,9 @@ index aaf853e3a2a..e2dd3587ed5 100644
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
$(SIMD_PATH_TARGET_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 591d033fbca..a485cbf15b9 100644
index 8522094164e..92b230a462b 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@ -75,7 +75,7 @@ index 591d033fbca..a485cbf15b9 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3446,7 +3451,6 @@ __gnat_lwp_self (void)
@@ -3438,7 +3443,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@ -83,7 +83,7 @@ index 591d033fbca..a485cbf15b9 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
@@ -3456,7 +3460,7 @@ __gnat_lwp_self (void)
@@ -3448,7 +3452,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@ -92,7 +92,7 @@ index 591d033fbca..a485cbf15b9 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3469,33 +3473,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3461,33 +3465,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@ -134,7 +134,7 @@ index 591d033fbca..a485cbf15b9 100644
}
size_t
@@ -3505,23 +3509,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3497,23 +3501,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@ -164,10 +164,10 @@ index 591d033fbca..a485cbf15b9 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 2631be5ad3e..d442f4bd6cd 100644
index 987432c9307..4d782f07de9 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -321,13 +321,11 @@ extern void *__gnat_lwp_self (void);
@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@ -186,10 +186,10 @@ index 2631be5ad3e..d442f4bd6cd 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index 32d30a49c7e..d960e32e2d0 100644
index c0ee4a16bb1..ed796a48c1b 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1127,7 +1127,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
/* 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)
@ -198,7 +198,7 @@ index 32d30a49c7e..d960e32e2d0 100644
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
@@ -1146,7 +1146,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1141,7 +1141,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
@ -207,7 +207,7 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
@@ -1195,8 +1195,8 @@ allocate_pty_desc (pty_desc **desc) {
@@ -1190,8 +1190,8 @@ allocate_pty_desc (pty_desc **desc) {
int master_fd = -1;
char *slave_name = NULL;
@ -218,3 +218,6 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.40.1

View file

@ -1,7 +1,7 @@
From 573a66e4146c9a65d895af9081a4d3d49cfc9e7a Mon Sep 17 00:00:00 2001
From 944dead3994c1a9bab757ad61e836e2317b8aa30 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
Date: Wed, 9 Dec 2020 07:42:06 +0000
Subject: [PATCH 27/33] configure: Add --enable-autolink-libatomic, use in
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
This fixes issues with RISC-V.
@ -9,19 +9,19 @@ This fixes issues with RISC-V.
Makefile.in | 1 +
gcc/config.in | 6 ++++++
gcc/config/gnu-user.h | 12 +++++++++++-
gcc/configure | 32 ++++++++++++++++++++++++++++++--
gcc/configure.ac | 22 +++++++++++++++++++++-
gcc/configure | 31 ++++++++++++++++++++++++++++++-
gcc/configure.ac | 21 +++++++++++++++++++++
gcc/doc/install.texi | 8 ++++++++
gcc/doc/tm.texi | 8 +++++++-
gcc/doc/tm.texi.in | 8 +++++++-
gcc/gcc.cc | 12 +++++++++++-
9 files changed, 102 insertions(+), 7 deletions(-)
9 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b564ddbf792..a95c7407d16 100644
index 6ff2b3f9925..394b105b271 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -232,6 +232,7 @@ HOST_EXPORTS = \
@@ -235,6 +235,7 @@ HOST_EXPORTS = \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@ -30,7 +30,7 @@ index b564ddbf792..a95c7407d16 100644
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
diff --git a/gcc/config.in b/gcc/config.in
index f0fbf123aa8..af84efc4f9e 100644
index 0679fbbf4c6..ee81139b385 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -118,6 +118,12 @@
@ -47,7 +47,7 @@ index f0fbf123aa8..af84efc4f9e 100644
format instead of DPD */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8433e56c3e1..0347f10da8b 100644
index b26b17f2f2a..3f64ea46180 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -71,10 +71,10 @@ index 8433e56c3e1..0347f10da8b 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/configure b/gcc/configure
index 2f6b3265a6c..6dc65bf4ccb 100755
index e59cbee1767..787c35d4e25 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -981,6 +981,7 @@ with_changes_root_url
@@ -984,6 +984,7 @@ with_changes_root_url
enable_languages
with_multilib_list
with_multilib_generator
@ -82,7 +82,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
with_zstd
with_zstd_include
with_zstd_lib
@@ -1710,6 +1711,9 @@ Optional Features:
@@ -1713,6 +1714,9 @@ Optional Features:
--disable-shared don't provide a shared libgcc
--disable-gcov don't provide libgcov and related host tools
--enable-languages=LIST specify which front-ends to build
@ -92,7 +92,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
--disable-rpath do not hardcode runtime library paths
--enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling
@@ -8324,7 +8328,6 @@ else
@@ -8329,7 +8333,6 @@ else
fi
@ -100,7 +100,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# Check whether --with-multilib-generator was given.
if test "${with_multilib_generator+set}" = set; then :
withval=$with_multilib_generator; :
@@ -8332,6 +8335,32 @@ else
@@ -8337,6 +8340,32 @@ else
with_multilib_generator=default
fi
@ -133,16 +133,11 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# -------------------------
# Checks for other programs
@@ -34296,4 +34325,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e683d3a7a5f..07c81c78336 100644
index 57268319de1..56bcaa87620 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1205,6 +1205,27 @@ AC_ARG_WITH(multilib-generator,
@@ -1199,6 +1199,27 @@ AC_ARG_WITH(multilib-generator,
:,
with_multilib_generator=default)
@ -170,16 +165,11 @@ index e683d3a7a5f..07c81c78336 100644
# -------------------------
# Checks for other programs
# -------------------------
@@ -7839,4 +7860,3 @@ done
],
[subdirs='$subdirs'])
AC_OUTPUT
-
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 48408d842db..c90be0ee750 100644
index 928fc6b6d4b..81a677014df 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2295,6 +2295,14 @@ files, but these changed header paths may conflict with some compilation
@@ -2374,6 +2374,14 @@ files, but these changed header paths may conflict with some compilation
environments. Enabled by default, and may be disabled using
@option{--disable-canonical-system-headers}.
@ -195,7 +185,7 @@ index 48408d842db..c90be0ee750 100644
Tell GCC that when the GNU C Library (glibc) is used on the target it
will be version @var{major}.@var{minor} or later. Normally this can
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c5006afc00d..56b62c69ae8 100644
index a660e33739b..6183c407a2b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -214,7 +204,7 @@ index c5006afc00d..56b62c69ae8 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index f869ddd5e5b..57c93f24ac3 100644
index f7ab5d48a63..281540aba68 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -233,10 +223,10 @@ index f869ddd5e5b..57c93f24ac3 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 735b2b1bba1..f10f3c91aa7 100644
index 59390fd39d6..dae1dd4cf79 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,13 +987,23 @@ proper position among the other output files. */
@@ -974,13 +974,23 @@ proper position among the other output files. */
# define ASM_DEBUG_OPTION_SPEC ""
#endif
@ -261,3 +251,6 @@ index 735b2b1bba1..f10f3c91aa7 100644
#endif
#ifdef ENABLE_DEFAULT_SSP
--
2.40.1

View file

@ -1,8 +1,8 @@
From 4baaeb9661fa4015d9701e3616ce1ad4e8a07fd8 Mon Sep 17 00:00:00 2001
From 8ce637988d0c463544c6b95e3a543380854fb73c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 29 Aug 2021 09:45:27 +0200
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
configure script
Date: Sun, 29 Aug 2021 12:23:34 +0200
Subject: [PATCH 28/33] configure: fix detection of atomic builtins in
libatomic configure script
Alpine's --enable-autolink-libatomic (which is enabled for riscv64 by
default) causes the libatomic configure script to incorrectly detect
@ -22,7 +22,7 @@ See:
1 file changed, 20 insertions(+)
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index 33f8c91ce77..3999db2cf8a 100644
index a92ae9e8309..90b579ca4d8 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -30,6 +30,26 @@
@ -52,3 +52,6 @@ index 33f8c91ce77..3999db2cf8a 100644
case "${target_cpu}" in
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.40.1

View file

@ -1,15 +1,15 @@
From 20c84de53efcb86993f1a1909e65a97240d6123e Mon Sep 17 00:00:00 2001
From 2f005ed8d54415aa609e3b5ade3ef80bb04f0cf4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 30 Jun 2022 17:08:36 +0000
Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl
targets
Date: Thu, 30 Jun 2022 16:44:51 +0000
Subject: [PATCH 29/33] libstdc++: do not throw exceptions for non-C locales on
musl targets
---
libstdc++-v3/config/locale/generic/c_locale.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index 1e4db8d4415..9b79bc3c5dd 100644
index 8849d78fdfa..aff467f98fe 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@ -22,3 +22,6 @@ index 1e4db8d4415..9b79bc3c5dd 100644
}
void
--
2.40.1

View file

@ -1,7 +1,8 @@
From b6554d1207d0f5771c2f5d11316b61787e4dd705 Mon Sep 17 00:00:00 2001
From 65f85fc6750b5d6735f7688c832244ffca2b8ab1 Mon Sep 17 00:00:00 2001
From: Mathias LANG <pro.mathias.lang@gmail.com>
Date: Mon, 17 Jan 2022 16:31:09 +0000
Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext
Date: Mon, 17 Jan 2022 03:49:21 +0000
Subject: [PATCH 30/33] gdc: unconditionally link libgphobos against
libucontext
ref: alpine/aports#13422
---
@ -9,10 +10,10 @@ ref: alpine/aports#13422
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index a95c7407d16..ea942d60387 100644
index 394b105b271..bc4a77fc300 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53287,7 +53287,7 @@ configure-target-libphobos:
@@ -52809,7 +52809,7 @@ configure-target-libphobos:
esac; \
module_srcdir=libphobos; \
rm -f no-such-file || : ; \
@ -21,3 +22,6 @@ index a95c7407d16..ea942d60387 100644
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.40.1

View file

@ -1,7 +1,7 @@
From 39f5c9a850917a3c19630c0115ef0d5b0f151c72 Mon Sep 17 00:00:00 2001
From 1c7088d3182fac082706bfa9ec3864291b91b2b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 16 Jul 2022 13:26:49 +0200
Subject: [PATCH] druntime: link against libucontext on all platforms
Date: Sat, 16 Jul 2022 09:21:11 +0200
Subject: [PATCH 31/33] druntime: link against libucontext on all platforms
On musl-based Linux distributions, swapcontext etc. are not provided by
musl but instead by libucontext. Hence, we _always_ need to link against
@ -12,10 +12,10 @@ an external library for these functions.
2 files changed, 16 deletions(-)
diff --git a/libphobos/configure b/libphobos/configure
index 9da06f087d0..0db0acfb9c2 100755
index 925c53c5f5e..60c2a0c11c6 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -15192,14 +15192,6 @@ fi
@@ -15216,14 +15216,6 @@ fi
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
@ -49,3 +49,6 @@ index 45a56f6f76a..fef6e890b1e 100644
if test "$druntime_fiber_asm_external" = no; then
AC_SEARCH_LIBS([swapcontext], [c ucontext], [],
AC_MSG_ERROR([swapcontext required but not found]))
--
2.40.1

View file

@ -1,14 +1,14 @@
From 4b28b8356c7ecf9375a2c07ac6be226a5693f8d2 Mon Sep 17 00:00:00 2001
From 5dd552d33be47ea3b7586df7dc4812b2cd3b0a5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Tue, 19 Jul 2022 01:05:11 +0200
Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc
Date: Tue, 19 Jul 2022 14:54:07 +0200
Subject: [PATCH 32/33] libgnat: time_t is always 64-bit on musl libc
---
gcc/ada/libgnat/s-parame.ads | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads
index 4b8111402ba..b670e78c53b 100644
index 3d6e345a1ba..cfe0b4d3ca6 100644
--- a/gcc/ada/libgnat/s-parame.ads
+++ b/gcc/ada/libgnat/s-parame.ads
@@ -102,7 +102,7 @@ package System.Parameters is
@ -20,3 +20,6 @@ index 4b8111402ba..b670e78c53b 100644
-- Number of bits in type time_t
----------------------------------------------
--
2.40.1

View file

@ -0,0 +1,39 @@
From 2f41b10437653f7dfee027dc623a94ac4054773c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 14 May 2023 19:30:21 +0200
Subject: [PATCH 33/33] fix assert in __deregister_frame_info_bases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The assertion in __deregister_frame_info_bases assumes that for every
frame something was inserted into the lookup data structure by
__register_frame_info_bases. Unfortunately, this does not necessarily
hold true as the btree_insert call in __register_frame_info_bases will
not insert anything for empty ranges. Therefore, we need to explicitly
account for such empty ranges in the assertion as `ob` will be a null
pointer for such ranges, hence causing the assertion to fail.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
---
libgcc/unwind-dw2-fde.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
index 7b74c391ced..8683a65aa02 100644
--- a/libgcc/unwind-dw2-fde.c
+++ b/libgcc/unwind-dw2-fde.c
@@ -278,7 +278,9 @@ __deregister_frame_info_bases (const void *begin)
__gthread_mutex_unlock (&object_mutex);
#endif
- gcc_assert (in_shutdown || ob);
+ // If we didn't find anything in the lookup data structures then they
+ // were either already destroyed or we tried to remove an empty range.
+ gcc_assert (in_shutdown || ((range[1] - range[0]) == 0 || ob));
return (void *) ob;
}
--
2.40.1

View file

@ -1,101 +0,0 @@
From ecc2a2e70e44fa76a75b12d0893bc1702b72a1b4 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Mon, 19 Dec 2022 10:37:06 -0800
Subject: [PATCH] libgo: check for makecontext in -lucontext
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patch from Sören Tempel.
Change-Id: I74b4052cc7aca19224afd6d9a2739c3fae46b722
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/458396
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/configure | 57 ++++++++++++++++++++++++++++++++++++++++++++++
libgo/configure.ac | 3 +++
2 files changed, 60 insertions(+)
diff --git a/libgo/configure b/libgo/configure
index 460fdad7..a607dbff 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -14818,6 +14818,63 @@ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing makecontext" >&5
+$as_echo_n "checking for library containing makecontext... " >&6; }
+if ${ac_cv_search_makecontext+:} 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 makecontext ();
+int
+main ()
+{
+return makecontext ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' 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_makecontext=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_makecontext+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_makecontext+:} false; then :
+
+else
+ ac_cv_search_makecontext=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_makecontext" >&5
+$as_echo "$ac_cv_search_makecontext" >&6; }
+ac_res=$ac_cv_search_makecontext
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
$as_echo_n "checking for library containing sched_yield... " >&6; }
if ${ac_cv_search_sched_yield+:} false; then :
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 09554a37..a59aa091 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -570,6 +570,9 @@ PTHREAD_LIBS=
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
+dnl Test if -lucontext is required for makecontext.
+AC_SEARCH_LIBS([makecontext], [ucontext])
+
dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
AC_SEARCH_LIBS([sched_yield], [rt])
AC_SEARCH_LIBS([nanosleep], [rt])

View file

@ -1,204 +0,0 @@
From b3840bdcc0eee2a4d099a9af52199944ade7acb9 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Tue, 29 Nov 2022 17:28:44 -0800
Subject: [PATCH] syscall, runtime: always call XSI strerror_r
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This does the right thing for either glibc or musl on GNU/Linux.
Based on patch by Sören Tempel.
Change-Id: If2969e131f0fae456d58b35d839d8abe191fcc59
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/454176
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
---
libgo/Makefile.am | 1 +
libgo/Makefile.in | 6 +++++-
libgo/go/syscall/errstr.go | 22 ++++++++-----------
libgo/go/syscall/errstr_glibc.go | 33 ----------------------------
libgo/runtime/go-strerror.c | 37 ++++++++++++++++++++++++++++++++
5 files changed, 52 insertions(+), 47 deletions(-)
delete mode 100644 libgo/go/syscall/errstr_glibc.go
create mode 100644 libgo/runtime/go-strerror.c
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index e0a1eec5..df568743 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -465,6 +465,7 @@ runtime_files = \
runtime/go-nanotime.c \
runtime/go-now.c \
runtime/go-nosys.c \
+ runtime/go-strerror.c \
runtime/go-reflect-call.c \
runtime/go-setenv.c \
runtime/go-signal.c \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 7bef5df9..f2f3f0fc 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -247,7 +247,7 @@ am__objects_4 = runtime/aeshash.lo runtime/go-assert.lo \
runtime/go-fieldtrack.lo runtime/go-matherr.lo \
runtime/go-memclr.lo runtime/go-memmove.lo \
runtime/go-memequal.lo runtime/go-nanotime.lo \
- runtime/go-now.lo runtime/go-nosys.lo \
+ runtime/go-now.lo runtime/go-nosys.lo runtime/go-strerror.lo \
runtime/go-reflect-call.lo runtime/go-setenv.lo \
runtime/go-signal.lo runtime/go-unsafe-pointer.lo \
runtime/go-unsetenv.lo runtime/go-unwind.lo \
@@ -917,6 +917,7 @@ runtime_files = \
runtime/go-nanotime.c \
runtime/go-now.c \
runtime/go-nosys.c \
+ runtime/go-strerror.c \
runtime/go-reflect-call.c \
runtime/go-setenv.c \
runtime/go-signal.c \
@@ -1390,6 +1391,8 @@ runtime/go-now.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-nosys.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
+runtime/go-strerror.lo: runtime/$(am__dirstamp) \
+ runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-reflect-call.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-setenv.lo: runtime/$(am__dirstamp) \
@@ -1457,6 +1460,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-reflect-call.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-setenv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-signal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-strerror.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsafe-pointer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsetenv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unwind.Plo@am__quote@
diff --git a/libgo/go/syscall/errstr.go b/libgo/go/syscall/errstr.go
index 6c2441d3..9f688e2a 100644
--- a/libgo/go/syscall/errstr.go
+++ b/libgo/go/syscall/errstr.go
@@ -4,23 +4,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !hurd
-// +build !linux
-
package syscall
-//sysnb strerror_r(errnum int, buf []byte) (err Errno)
-//strerror_r(errnum _C_int, buf *byte, buflen Size_t) _C_int
+import "internal/bytealg"
+
+//extern go_strerror
+func go_strerror(_C_int, *byte, Size_t) _C_int
func Errstr(errnum int) string {
- for len := 128; ; len *= 2 {
- b := make([]byte, len)
- errno := strerror_r(errnum, b)
+ for size := 128; ; size *= 2 {
+ b := make([]byte, size)
+ errno := go_strerror(_C_int(errnum), &b[0], Size_t(len(b)))
if errno == 0 {
- i := 0
- for b[i] != 0 {
- i++
- }
+ i := bytealg.IndexByte(b, 0)
// Lowercase first letter: Bad -> bad, but
// STREAM -> STREAM.
if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
@@ -29,7 +25,7 @@ func Errstr(errnum int) string {
return string(b[:i])
}
if errno != ERANGE {
- return "errstr failure"
+ return "strerror_r failure"
}
}
}
diff --git a/libgo/go/syscall/errstr_glibc.go b/libgo/go/syscall/errstr_glibc.go
deleted file mode 100644
index 5b19e6f2..00000000
--- a/libgo/go/syscall/errstr_glibc.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// errstr_glibc.go -- GNU/Linux and GNU/Hurd specific error strings.
-
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// We use this rather than errstr.go because on GNU/Linux sterror_r
-// returns a pointer to the error message, and may not use buf at all.
-
-// +build hurd linux
-
-package syscall
-
-import "unsafe"
-
-//sysnb strerror_r(errnum int, b []byte) (errstr *byte)
-//strerror_r(errnum _C_int, b *byte, len Size_t) *byte
-
-func Errstr(errnum int) string {
- a := make([]byte, 128)
- p := strerror_r(errnum, a)
- b := (*[1000]byte)(unsafe.Pointer(p))
- i := 0
- for b[i] != 0 {
- i++
- }
- // Lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
- c := b[0] + 'a' - 'A'
- return string(c) + string(b[1:i])
- }
- return string(b[:i])
-}
diff --git a/libgo/runtime/go-strerror.c b/libgo/runtime/go-strerror.c
new file mode 100644
index 00000000..13d1d91d
--- /dev/null
+++ b/libgo/runtime/go-strerror.c
@@ -0,0 +1,37 @@
+/* go-strerror.c -- wrapper around XSI-compliant strerror_r.
+
+ Copyright 2022 The Go Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style
+ license that can be found in the LICENSE file. */
+
+/* There are two version of strerror_r on GNU/Linux: a GNU-specific
+ and an XSI-compliant version. The former version is only available
+ on glibc. Since glibc 2.13, the XSI-compliant version is also
+ provided by glibc if _GNU_SOURCE is not defined. Since the
+ entirety of gofrontend is compiled with _GNU_SOURCE, this file
+ exists to selectively undefine it and provides an alias to the
+ XSI-compliant version of strerror_r(3). */
+
+#ifdef __linux__
+
+/* Force selection of XSI-compliant strerror_r by glibc. */
+#undef XOPEN_SOURCE
+#define XOPEN_SOURCE 600
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200112L
+#undef _GNU_SOURCE
+
+#endif /* __linux__ */
+
+#include <string.h>
+
+#ifndef HAVE_STRERROR_R
+// Provided by go-nosys.c if not provided by libc itself.
+extern int strerror_r (int, char *, size_t);
+#endif
+
+int
+go_strerror (int errnum, char *buf, size_t buflen)
+{
+ return strerror_r (errnum, buf, buflen);
+}

View file

@ -1,199 +0,0 @@
From 3b9243b891cc06373639a23ed5717b0d1c2d8ea6 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Tue, 14 Jun 2022 06:13:43 -0700
Subject: [PATCH] libgo: permit loff_t and off_t to be macros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
They are macros in musl libc, rather than typedefs, and -fgo-dump-spec
doesn't handle that case.
Based on patch by Sören Tempel.
Change-Id: Ic9a608fd964a6f78e754aa8e3100aff06ab3dade
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/412075
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
libgo: #include <sys/types.h> when checking for loff_t
Fixes https://gcc.gnu.org/PR106033
Fixes golang/go#53469
Change-Id: I060021b7bb9334949b567442448abb6822fd6d35
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413214
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/config.h.in | 3 +++
libgo/configure | 12 ++++++++++--
libgo/configure.ac | 11 +++++++++--
libgo/go/syscall/libcall_linux.go | 17 +++++++++--------
libgo/mksysinfo.sh | 6 +-----
libgo/sysinfo.c | 15 ++++++++++++++-
6 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/libgo/config.h.in b/libgo/config.h.in
index 25b8ab8f9ee..2c3c7469675 100644
--- a/libgo/config.h.in
+++ b/libgo/config.h.in
@@ -70,6 +70,9 @@
/* Define to 1 if you have the `fchownat' function. */
#undef HAVE_FCHOWNAT
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
/* Define to 1 if you have the `futimesat' function. */
#undef HAVE_FUTIMESAT
diff --git a/libgo/configure b/libgo/configure
index ffe17c9be55..61a49947eb9 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -15249,7 +15249,7 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
-for ac_header in port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h
+for ac_header in fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -15546,7 +15546,14 @@ _ACEOF
fi
-ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "$ac_includes_default"
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "
+#include <sys/types.h>
+#include <fcntl.h>
+
+"
if test "x$ac_cv_type_loff_t" = xyes; then :
cat >>confdefs.h <<_ACEOF
@@ -15556,6 +15563,7 @@ _ACEOF
fi
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 7e2b98ba67c..274fcfc35c7 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -579,7 +579,7 @@ AC_C_BIGENDIAN
GCC_CHECK_UNWIND_GETIPINFO
-AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
+AC_CHECK_HEADERS(fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
[#include <netinet/in.h>
@@ -601,7 +601,14 @@ AC_STRUCT_DIRENT_D_TYPE
AC_CHECK_FUNCS(accept4 dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat open64 openat pipe2 removexattr renameat setxattr sync_file_range splice syscall tee unlinkat unshare utimensat)
AC_TYPE_OFF_T
-AC_CHECK_TYPES([loff_t])
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+AC_CHECK_TYPES([loff_t], [], [], [[
+#include <sys/types.h>
+#include <fcntl.h>
+]])
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 96974bd3269..65eb1a745f7 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -209,19 +209,20 @@ func Gettid() (tid int) {
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
-//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
+//sys splice(rfd int, roff *_libgo_loff_t_type, wfd int, woff *_libgo_loff_t_type, len int, flags int) (n int64, err error)
+//splice(rfd _C_int, roff *_libgo_loff_t_type, wfd _C_int, woff *_libgo_loff_t_type, len Size_t, flags _C_uint) Ssize_t
+
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
- var lroff _loff_t
- var plroff *_loff_t
+ var lroff _libgo_loff_t_type
+ var plroff *_libgo_loff_t_type
if roff != nil {
- lroff = _loff_t(*roff)
+ lroff = _libgo_loff_t_type(*roff)
plroff = &lroff
}
- var lwoff _loff_t
- var plwoff *_loff_t
+ var lwoff _libgo_loff_t_type
+ var plwoff *_libgo_loff_t_type
if woff != nil {
- lwoff = _loff_t(*woff)
+ lwoff = _libgo_loff_t_type(*woff)
plwoff = &lwoff
}
n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 0c52ea5d71a..5aa309155c3 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -403,11 +403,7 @@ fi
# Some basic types.
echo 'type Size_t _size_t' >> ${OUT}
echo "type Ssize_t _ssize_t" >> ${OUT}
-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
- echo "type Offset_t _off64_t" >> ${OUT}
-else
- echo "type Offset_t _off_t" >> ${OUT}
-fi
+echo "type Offset_t _libgo_off_t_type" >> ${OUT}
echo "type Mode_t _mode_t" >> ${OUT}
echo "type Pid_t _pid_t" >> ${OUT}
echo "type Uid_t _uid_t" >> ${OUT}
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index 336a5983750..fc0210992fa 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,18 @@ enum {
};
#endif
+#if defined(HAVE_LOFF_T)
+// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
+// see a typedef.
+typedef loff_t libgo_loff_t_type;
+#endif
+
+#if defined(HAVE_OFF64_T)
+typedef off64_t libgo_off_t_type;
+#else
+typedef off_t libgo_off_t_type;
+#endif
+
// The following section introduces explicit references to types and
// constants of interest to support bootstrapping libgo using a
// compiler that doesn't support -fdump-go-spec (e.g., clang), via
@@ -534,7 +546,8 @@ SREF(timex);
// From sys/types.h
TREF(pid_t);
TREF(off_t);
-TREF(loff_t);
+TREF(libgo_loff_t_type);
+TREF(libgo_off_t_type);
TREF(size_t);
TREF(ssize_t);
TREF(mode_t);

View file

@ -1,59 +0,0 @@
From 5e658f4659c551330ea68f5667e4f951b218f32d Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 26 Oct 2022 17:23:42 -0700
Subject: [PATCH] runtime: use _libgo_off_t_type when calling C mmap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The last argument to the C mmap function is type off_t, not uintptr.
On some 32-bit systems, off_t is larger than uintptr.
Based on patch by Sören Tempel.
Change-Id: Ib6f9d5bcd4734f99a72889e2282b97ec3c8fbd34
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/445735
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/go/runtime/mem_gccgo.go | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go
index fa3389d8..1e84f4f5 100644
--- a/libgo/go/runtime/mem_gccgo.go
+++ b/libgo/go/runtime/mem_gccgo.go
@@ -15,7 +15,7 @@ import (
//go:linkname sysFree
//extern mmap
-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
+func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off _libgo_off_t_type) unsafe.Pointer
//extern munmap
func munmap(addr unsafe.Pointer, length uintptr) int32
@@ -38,7 +38,7 @@ func init() {
}
func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
- p := sysMmap(addr, n, prot, flags, fd, off)
+ p := sysMmap(addr, n, prot, flags, fd, _libgo_off_t_type(off))
if uintptr(p) == _MAP_FAILED {
return nil, errno()
}
@@ -47,6 +47,7 @@ func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (u
// Don't split the stack as this method may be invoked without a valid G, which
// prevents us from allocating more stack.
+//
//go:nosplit
func sysAlloc(n uintptr, sysStat *sysMemStat) unsafe.Pointer {
p, err := mmap(nil, n, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, mmapFD, 0)
@@ -165,6 +166,7 @@ func sysHugePage(v unsafe.Pointer, n uintptr) {
// Don't split the stack as this function may be invoked without a valid G,
// which prevents us from allocating more stack.
+//
//go:nosplit
func sysFree(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
sysStat.add(-int64(n))

View file

@ -1,71 +0,0 @@
From c86b726c048eddc1be320c0bf64a897658bee13d Mon Sep 17 00:00:00 2001
From: Uros Bizjak <ubizjak@gmail.com>
Date: Wed, 18 May 2022 20:03:26 +0200
Subject: [PATCH] x86: Fix -fsplit-stack feature detection via
TARGET_CAN_SPLIT_STACK
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since commit c163647ffbc9a20c8feb6e079dbecccfe016c82e -fsplit-stack
is only supported on glibc targets. However, this original commit
required some fixups. As part of the fixup, the changes to the
gnu-user-common.h and gnu.h were partially reverted in commit
60953a23d57b13a672f751bec0c6eefc059eb1ab thus causing TARGET_CAN_SPLIT_STACK
to be defined for non-glibc targets even though -fsplit-stack is
actually not supported and attempting to use it causes a runtime error.
This causes gcc internal code, such as ./gcc/go/gospec.c to not
correctly detect that -fsplit-stack is not supported and thus causes
gccgo to fail compilation on non-glibc targets.
This commit ensures that TARGET_CAN_SPLIT_STACK is only set if the
default libc is glibc. It is presently unclear to me if there is a
better way to detect glibc at pre-processor time.
The proposed changes have been tested on x86 and x86_64 Alpine Linux
(which uses musl libc) and fix compilation of gccgo for this target.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
gcc/ChangeLog:
* config/i386/gnu-user-common.h (defined): Only define
TARGET_CAN_SPLIT_STACK for glibc targets.
* config/i386/gnu.h (defined): Ditto.
---
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 23b54c5be52..cab9be2bfb7 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if (DEFAULT_LIBC == LIBC_GLIBC) && HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 401e60c9a02..fb8d69a97d8 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -41,8 +41,9 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
#define TARGET_THREAD_SSP_OFFSET 0x14
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if (DEFAULT_LIBC == LIBC_GLIBC) && HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
/* We steal the last transactional memory word. */

View file

@ -1,41 +0,0 @@
From 548720bca6bff21ebc9aba22249d9ce45bbd90c7 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 29 Jun 2022 15:32:04 -0700
Subject: [PATCH] libgo: handle stat st_atim32 field and SYS_SECCOMP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patches for musl support, from Sören Tempel.
Fixes https://gcc.gnu.org/PR105225
Change-Id: If396877d4a4c7d27962226d7a6e3bb91b1344413
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415294
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/mksysinfo.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 5aa30915..ea1fa17d 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -127,6 +127,7 @@ fi
# The syscall numbers. We force the names to upper case.
grep '^const _SYS_' gen-sysinfo.go | \
+ grep -v '^const _SYS_SECCOMP = ' | \
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
while read sys; do
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
@@ -506,7 +507,7 @@ fi
# For historical reasons Go uses the suffix "timespec" instead of "tim" for
# stat_t's time fields on NetBSD.
-st_times='-e s/st_atim/Atim/ -e s/st_mtim/Mtim/ -e s/st_ctim/Ctim/'
+st_times='-e s/st_atim/Atim/g -e s/st_mtim/Mtim/g -e s/st_ctim/Ctim/g'
if test "${GOOS}" = "netbsd"; then
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi

View file

@ -1,108 +0,0 @@
From 8f1a91aeff400d572857895b7f5e863ec5a4d93e Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Mon, 26 Sep 2022 15:03:53 -0400
Subject: [PATCH] runtime: portable access to sigev_notify_thread_id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously, libgo relied on the _sigev_un implementation-specific
field in struct sigevent, which is only available on glibc.
This patch uses the sigev_notify_thread_id macro instead which is
mandated by timer_create(2). In theory, this should work with any libc
implementation for Linux. Unfortunately, there is an open glibc bug
as glibc does not define this macro. For this reason, a glibc-specific
workaround is required. Other libcs (such as musl) define the macro
and don't require the workaround.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27417
This makes libgo compatible with musl libc.
Based on patch by Sören Tempel.
Change-Id: I0924a53d5212730ebc395ecf9199f85967be8cc6
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/434755
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/go/runtime/os_linux.go | 12 +++++++++++-
libgo/runtime/go-signal.c | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/libgo/go/runtime/os_linux.go b/libgo/go/runtime/os_linux.go
index 96fb1788..2b2d827c 100644
--- a/libgo/go/runtime/os_linux.go
+++ b/libgo/go/runtime/os_linux.go
@@ -22,6 +22,12 @@ type mOS struct {
profileTimerValid uint32
}
+// setSigeventTID is written in C to set the sigev_notify_thread_id
+// field of a sigevent struct.
+//
+//go:noescape
+func setSigeventTID(*_sigevent, int32)
+
func getProcID() uint64 {
return uint64(gettid())
}
@@ -52,9 +58,12 @@ const (
)
// Atomically,
+//
// if(*addr == val) sleep
+//
// Might be woken up spuriously; that's allowed.
// Don't sleep longer than ns; ns < 0 means forever.
+//
//go:nosplit
func futexsleep(addr *uint32, val uint32, ns int64) {
// Some Linux kernels have a bug where futex of
@@ -73,6 +82,7 @@ func futexsleep(addr *uint32, val uint32, ns int64) {
}
// If any procs are sleeping on addr, wake up at most cnt.
+//
//go:nosplit
func futexwakeup(addr *uint32, cnt uint32) {
ret := futex(unsafe.Pointer(addr), _FUTEX_WAKE_PRIVATE, cnt, nil, nil, 0)
@@ -365,7 +375,7 @@ func setThreadCPUProfiler(hz int32) {
var sevp _sigevent
sevp.sigev_notify = _SIGEV_THREAD_ID
sevp.sigev_signo = _SIGPROF
- *((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
+ setSigeventTID(&sevp, int32(mp.procid))
ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
if ret != 0 {
// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index 528d9b6d..aa1b6305 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -183,6 +183,24 @@ setSigactionHandler(struct sigaction* sa, uintptr handler)
sa->sa_sigaction = (void*)(handler);
}
+#ifdef __linux__
+
+// Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=27417
+#ifndef sigev_notify_thread_id
+ #define sigev_notify_thread_id _sigev_un._tid
+#endif
+
+void setSigeventTID(struct sigevent*, int32_t)
+ __asm__ (GOSYM_PREFIX "runtime.setSigeventTID");
+
+void
+setSigeventTID(struct sigevent *sev, int32_t v)
+{
+ sev->sigev_notify_thread_id = v;
+}
+
+#endif // defined(__linux__)
+
// C code to fetch values from the siginfo_t and ucontext_t pointers
// passed to a signal handler.

View file

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

View file

@ -1,36 +0,0 @@
From d53e8a0e94e34dc609e34dd5e404debda2640cfb Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Sat, 30 Jul 2022 07:29:28 -0700
Subject: [PATCH] libgo: use SYS_timer_settime32
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Musl defines SYS_timer_settime32, not SYS_timer_settime, on 32-bit systems.
Based on patch by Sören Tempel.
Change-Id: I1f3485028d132ceca1aba595325af24b4d72b894
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/420222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
---
libgo/sysinfo.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index fc021099..180f5c31 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,11 @@ enum {
};
#endif
+#if !defined(SYS_timer_settime) && defined(SYS_timer_settime32)
+// musl defines SYS_timer_settim32 on 32-bit systems.
+#define SYS_timer_settime SYS_timer_settime32
+#endif
+
#if defined(HAVE_LOFF_T)
// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
// see a typedef.

View file

@ -1,50 +0,0 @@
From a62f20ae78ddd41be682dde8cab075ca4f5dbb2a Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Fri, 22 Jul 2022 11:38:20 -0700
Subject: [PATCH] libgo: use POSIX shell arithmetic expansion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Avoid bash-specific ((expression)) syntax. As the bash syntax
converts a non-zero value to a zero status (and a zero value to a 1
status), and POSIX arithmetic expansion does not, we have to negate
the result.
Based on patch by Sören Tempel.
Change-Id: I4c64fa15de3994a1a5c7c5ec0de6a82ddd858917
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/419154
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/match.sh | 2 +-
libgo/testsuite/gotest | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgo/match.sh b/libgo/match.sh
index 7ed587ff..e5ed98de 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -111,7 +111,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((!($line)))
}
matched=
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 04e4267f..0a0a7e14 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -302,7 +302,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((!($line)))
}
case "x$gofiles" in

View file

@ -1,65 +0,0 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1

View file

@ -24,15 +24,15 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-aarch64
_pkgbase=12.2.1 # must match gcc/BASE-VER
_pkgsnap=20220924
_pkgbase=13.1.1 # must match gcc/BASE-VER
_pkgsnap=20230513
pkgver=${_pkgbase}_git$_pkgsnap
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64
pkgrel=10
pkgrel=1
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
@ -40,10 +40,9 @@ license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-aarch64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
# XXX: build hack to upgrade live on builders
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
subpackages="g++-aarch64:gpp libstdc++-dev-aarch64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
replaces="libstdc++ binutils"
: "${LANG_CXX:=true}"
@ -77,11 +76,13 @@ if [ "$CHOST" != "$CTARGET" ]; then
_libatomic=false
_libitm=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/}"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@ -89,10 +90,12 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/}"
unset CPPFLAGS
# reset flags and cc for build
@ -117,6 +120,21 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# pass -g0 by default to bypass -g, since we don't do debug
# if -dbg added, the -g is appended and overrides this
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/} -O2"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/} -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
case "$CARCH" in
@ -148,7 +166,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
*) _libquadmath=false ;;
esac
@ -225,41 +243,28 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${
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-dlang-use-libucontext-on-mips64.patch
0016-ada-fix-shared-linking.patch
0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0018-add-fortify-headers-paths.patch
0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0021-mips64-disable-multilib-support.patch
0022-aarch64-disable-multilib-support.patch
0023-s390x-disable-multilib-support.patch
0024-ppc64-le-disable-multilib-support.patch
0025-x86_64-disable-multilib-support.patch
0026-riscv-disable-multilib-support.patch
0027-always-build-libgcc_eh.a.patch
0028-ada-libgnarl-compatibility-for-musl.patch
0029-ada-musl-support-fixes.patch
0033-gcc-go-link-to-libucontext.patch
0034-Use-generic-errstr.go-implementation-on-musl.patch
0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
0045-druntime-link-against-libucontext-on-all-platforms.patch
0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
0012-libgcc_s.patch
0013-nopie.patch
0014-ada-fix-shared-linking.patch
0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0016-add-fortify-headers-paths.patch
0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0019-aarch64-disable-multilib-support.patch
0020-s390x-disable-multilib-support.patch
0021-ppc64-le-disable-multilib-support.patch
0022-x86_64-disable-multilib-support.patch
0023-riscv-disable-multilib-support.patch
0024-always-build-libgcc_eh.a.patch
0025-ada-libgnarl-compatibility-for-musl.patch
0026-ada-musl-support-fixes.patch
0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
0031-druntime-link-against-libucontext-on-all-platforms.patch
0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0033-fix-assert-in-__deregister_frame_info_bases.patch
"
# we build out-of-tree
@ -358,11 +363,7 @@ build() {
echo " hash_style_configure=$_hash_style_configure"
echo ""
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2"
export CPPFLAGS="$CPPFLAGS -O2"
local version="Alpine $pkgver-r$pkgrel"
local version="Alpine $pkgver"
local gccconfiguration="
--prefix=/usr
--mandir=/usr/share/man
@ -371,6 +372,7 @@ build() {
--host=$CHOST
--target=$CTARGET
--enable-checking=release
--disable-cet
--disable-fixed-point
--disable-libstdcxx-pch
--disable-multilib
@ -381,6 +383,8 @@ build() {
--enable-default-pie
--enable-default-ssp
--enable-languages=$_languages
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
$_cross_configure
@ -553,6 +557,7 @@ libcxx_dev() {
replaces="g++"
amove usr/${_target:+$CTARGET/}lib/libstdc++.a \
usr/${_target:+$CTARGET/}lib/libstdc++exp.a \
usr/${_target:+$CTARGET/}lib/libstdc++.so \
usr/${_target:+$CTARGET/}lib/libstdc++fs.a \
usr/${_target:+$CTARGET/}lib/libsupc++.a \
@ -763,52 +768,48 @@ gnat() {
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
}
gdb() {
pkgdesc="$pkgdesc (gdb printers)"
install_if="$pkgname=$pkgver-r$pkgrel gdb"
amove \
usr/share/gdb/python/ \
usr/share/gcc-*/python/
}
sha512sums="
ba4d9e73d108088da26fbefe18d9b245b76771ffe752c2b4b31bdf38a2d0b638fbc115c377526c27311d4d7ffd4e0d236a5af5016bd364ccaa11a4989d1401e8 gcc-12-20220924.tar.xz
41cbb4d69218006cf9e0cdb6c86212ef451f8decd52a50a7dbb4d34726009da7a4e0261c852b46cb584db253a4bae2f31dc485c506cb545e64a7d26e0ba6c2b6 0001-posix_memalign.patch
531155055cda7f119bcac6479bcae73af9201cd596af9cf1616850bbcf4393b91c5de9f2fbbc1cde6e158fb4df7237b033146f662dff5fa0ea12151cc514adb8 0002-gcc-poison-system-directories.patch
c1275d77b5269386a2ec683933570810f5a2ba1208c161ed887797eb9aee3cb82ef08a8964635902614e6a6e83f3065ba0801c9355d85dd8d60cb1fa20bdf687 0003-specs-turn-on-Wl-z-now-by-default.patch
a54e45bff4484a35d3826435a414d909281453f5605f4081cf3be1f15336cceed93a1d8a54e92e2fa97188623e3030ca1323d7749141e228a7db73795230d86a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
ad132ddbd0c33a3983e3de4f74d8fdb8cb1ddf53ef54de0a5c12efb49e42014ed117165d43f396bcf3455ecfe2c8620e0326e73b4160a370a4cc92d213329c34 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
0b9ce0f130a7b797770f3d58a5200575f20e5663c86c0c5710718b7bffd3416cc2f05861613d9c258428e9541c6e0b9837d01f0c99d383e2c3de0503a988e861 0006-Enable-Wformat-and-Wformat-security-by-default.patch
e7813acc7ead61373c212cefbe53eb020b4c5bd8f0f35ee972e0524060713f911624f5a1a871feada642e1f3f5e48c8508125ca2da09de351d544bedf1d44ada 0007-Enable-Wtrampolines-by-default.patch
d0d0566a11e4828bdd6f53346a9a6b9841f3066d3f4a05ee2b6fe97aeb4552654170e7662318ea18fc777c3e75c88a067097478fc4e880a3f9c134b8a3af2277 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
f75e63d9d933874f18fb7f55b135c60dfa0377abafa8e0edb91b85d5f00f4f072d0a338ba5d9baec18494211dbbda8068782830dbafbb37068936f76aede270f 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
afa4daba222a19569588736a8276dc7c12223a7c222f3dd3795dc3f1cd90f40b90518971ae27b358020354f89562c9680ec8b8e24e85e6d4f8e54e79d185359b 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
79dac82249fb573ec477e1451a33883302eb63a5110853faed117f5021221f2153e2ec845dd5a0043b1bf9f0e5736ef0c89743ff2d771774a281c8b24542803a 0011-libiberty-copy-PIC-objects-during-build-process.patch
b035f85c1703b45d15c1d1ffe7d23400e01625e5d403504911cc92f740b02586447de2a9d66a9f80f12b9c227bc193e2a43942c8af2bdb42cdeff8272bbe6068 0012-libitm-disable-FORTIFY.patch
9fb4d396a9493d2d68fe829ce075ba4c5df148b1d6aaab315a6f8ccbdd70d0e052a5dc50369adc2dab005b4a3becd1504b182faed6e82c86accb95f5bc2b9f50 0013-libgcc_s.patch
f82ac22961d842c9f8e731a601bb255918cc160969888363ad2d83e2ccf08b19114a200d46bcf99d097bf530f470c2b1e71e46828bc1b9fff5469ff945f541d8 0014-nopie.patch
6527dc9d250db48d56cf01e9299461bf22a838ffda96c40d448e18f457b206cec2322275d2d5abbbaf3c6573c5e7eba12724c9691b601f118ff7520e19726373 0015-dlang-use-libucontext-on-mips64.patch
6c3ce0ccd68b19e2c76172d8f24b0747ee0af2b8de7af692f2f699848267d7fc42fec8e5c303102fe05be7e934b56f21eea17ce47c8aca20570590830d88e9b0 0016-ada-fix-shared-linking.patch
7089a96aaec8e0b222cb3fa7301d71bb2e328a24dec33e15ea9e3e7695bcae919308249b9a3be5ea2f3b1f069f9fd1739066f31d12317fcdab0596dba9ca54a4 0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
b7ebdeee0b143052fdd6e3efa070ea8621d4fb729312cbc787d618e666b593990a20cd9044a786265970d8e09ec13da03b797009543d0b657b0fe924f2dcaa68 0018-add-fortify-headers-paths.patch
8e682893d6367732ab8c490b915112a68d98855deec3bd8db91dc0d9bf486b8c044b13ee2b95c4806da7ac17c41034e081b7a66861018274cb33fdb2fd6df04a 0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
a14c5f98ade5af8cd6e3a0244752674d9c4f6dadb4260f98f1949bff51ac1211a3f8319e0f933f776e98998d2c7221004f92413f97ccc2e966f8462ed6d33597 0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
28c1d477da79aa212ac79e4b02cf865d8b9c31cec6c42f41b4268e3f3c49bf67fb51e54180abe543a54e550788bb472bfcf1b4bc38d072a792d7403dbbee178a 0021-mips64-disable-multilib-support.patch
0920e31c46bf937b47a0602766f042d45adb71abf332ee84399c665c12298ef115cff945fe26d646b0276bfdfdd04913970e6f1f8784a11c26e15111c854643d 0022-aarch64-disable-multilib-support.patch
e4c6bf7ec40f2798c8e5b40a543aecffd5591a2805546b3b97aaa4fbe4df6ce4330a60973a9ddfbca9890590606d5204e7f653ab2b6e4b2c13feeb595b68e63a 0023-s390x-disable-multilib-support.patch
0e956d793c94283ce5af7fe84bfcbb655585a9573608e9bf497fa7b726e12daa391e44977d0a8c97fb460aba89b1773b91e036b0ee1ef4d6263a3943cb63d9cd 0024-ppc64-le-disable-multilib-support.patch
95917fcb60dbc0a8134db9beb583f3c9ea61128499c214f594c434ec8246641ec41e245ce2d1d9b85ffd40ea0e5764f7a33c5522b2547145814245ac0fa25025 0025-x86_64-disable-multilib-support.patch
b40d7e4712c035674c993bbb55475290ec14523b3f0fd05493514bac4e9adaa6641faf815fc40ffc00119d9fd64be28218ee874c289ec7430eeef05ab2fcae5e 0026-riscv-disable-multilib-support.patch
674360ce2ee9f704d0632cc98756f9fe8dd8ca30064fb9d3423b437f7e679c1c51e765b15e535dcb278cd2769583690acb3395b91e4fd5f6f4e3b97879fcc313 0027-always-build-libgcc_eh.a.patch
f060687adcd5297124e4000f1ba1e3fd5d7d124da04d948cbd0d4a6c69a90a2b29a4a0dbbe13a83ab6950724f434de012b681bdbcdf53c0100b40fe3d00f2f2f 0028-ada-libgnarl-compatibility-for-musl.patch
5160bae68e20a1966c1f6d655ee98af759e9b9ee842718ae6007d467b418e1cf3b307528a0841477b5259671ce868521b06c0f2e947b7b8f3a398c53dd978252 0029-ada-musl-support-fixes.patch
72631fbef4843d6ada52f3173b257e027605866a3faf1d8e34438cbf2581952f97bf6f9569ee44fcd7c4b3b337612eaeb0612fb2e6451903f219e4d99bf719db 0033-gcc-go-link-to-libucontext.patch
141c0428f988cbd102000d4db8d4150485f6da5c064469493ea378cd579bed99330658f41fe106c0d07d1c1aa436ec3f864403ed1ba79f791a1d727b42d46910 0034-Use-generic-errstr.go-implementation-on-musl.patch
d9ba710f770e053c8f212e821817c188091a829658050b9ab5906388553ec60fec37943ea43c270e92a9014902949f3c98fc4639032d92b8145b375bb29e193e 0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
ab90d8fdd977d6cd3da096a1c76d77be3e89a020b2127247771711a32eb608cceed21834ef488ab4b69bb0f408b098fdfb61630819e3d1a1e57d5af67800ee74 0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
8bc6823f0b3c66f7b73d7ddb64ffa6930463285c2e9a14a2bc1882bcc4271144eaa1107d713294699caf9481648163cbf43921a2b8e4ac0d55c78a804bae8a3d 0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
f0744c01859e67deed404c97e1870b2876935fdc467e51980373744936574c314d5d21134734c5d515e7f3cd3483ef98045b9bbcd81c568c6038fac96ffb5fa0 0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
d6dc1bfb881a313d167aaa5658790b0f55eea4336c408cfc6613dd5783440dafd0d37c43031a5f3e69be40f632e38371cd4fb6e5f0494ac4ea4d7d5025d2ae02 0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
684c6a6d52512b973429b6e709966439ac1e174f9e79a33d4a638b452245b457b34752b4b4034ba983f6a712f86522e7adf715bab00a6603f64a12139c5b1e39 0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
25014dfa99d96ee70ce0ad22e9f7974f0a51cc50b3b9c2db49df50774c8cd29e497ceed120486bee50be83bfb07f2009ed310eb9b0543f2795bd7359b87eadd2 0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
75fd83ac05ab0a08d5f48547b08810f9934209bc78b5db59d65f33887b382af7ec24d8a29d40f86325c05af40c1ae1ec6466c839f646af90afc895a13073d07b 0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
13e047153076d6e1fc40c9f5b6bfe5699c0e5460248f3d2b35ae36677cb960525af7b0b025997e5000a8492cec5e77a86828d66b4058c0d7f89fde0ab3890142 0045-druntime-link-against-libucontext-on-all-platforms.patch
c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2101dfd4eea2a6d48bf4fae899a0ddb811c81abd7be35c122 0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
179cd15d629884a66e954fd76066675efa594686b970facbb12ad50769e5d70b5530d7f61e77120e26d1c3dfc701cfc5295f341f635db998df73c41bc8e62172 0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
a82e38d273a668e4a8ad33282cb74661d125babcc6165eb0ada5da471154b2ed2894bf1fa462f0345f9d817e733b155c09a971885f3b7c04398ebcdd3b5551f5 gcc-13-20230513.tar.xz
275a71fcabc03209fe69894ee9c4bec57afabd170f08385fa148b4e481c0b2d2e5a3e2631e82551f21bc3f93c2b5299ddf39d09b88e1a5451d1cd4fb5ff3be06 0001-posix_memalign.patch
8c247b796c2cea016fe43b1c7393ed94567bd565e453fdf114d90800a86d1e5bb3761a26c9b48bccb7b3192ca482a72d02fa8b65e4703753ff8b567ddd8cb949 0002-gcc-poison-system-directories.patch
3c0773148638c41d2a45f43c8320bd9c7b1129650168f0f80bfe4cf9d00d11f352952f178c88285b5a5e47df76264304c05080b9df4948981c0d01bd7cce5cfa 0003-specs-turn-on-Wl-z-now-by-default.patch
cc81175e0e74abbb46dbc63d64c1a36fc62d4eae7ba3cc5ab85de331c31f3341fc445f3b5be7e1f53ee72e0e3a512232b821cef349a0a5991d46834d1325246e 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
c52396a1708b1b4a29e0b5a8d2843f4ea1eb2c34fd2fd9401da0c826a1192b6f87d8b5aea7429f4811c3e293c2fef1945ac05d7c82f3ce94c84f440bb772c76e 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
03f1ce1a6c90a438d4b953273ae31996fd54226b320f075cc5ebfe8f1c14958138922b8037774fc9a29d10c8b99303d8119a0075fbb45b608fc14f0b18ed3720 0006-Enable-Wformat-and-Wformat-security-by-default.patch
3c9f0cde600081e59e7542784839defa46e5bea7a19b9cfcfbf042f883a2a7a7547d0eeb6edea51cbb0682e20e25bde9e6597871d492cf5eaf9cfbd9475f7ce1 0007-Enable-Wtrampolines-by-default.patch
de8c97e379e9e85d57988ef3d2df2dd7f1f0a7e4e20c2bbc19f148bf3fbaccaf34e80fae8e8f60c6b9b4932135c14fd2f1a20624e44aa6d67ba92b29d36c6051 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
acc01ac7a8da1eb02915b5b82dd539b1e8ac5045faeb6db02f54390f77a3d7a8f0cf65c2927a4150e7a52ee4a7df31091d325dd45641cc6639883defda7d0d42 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
101ef48ce43aa084ab9875c1917388e1ae2b3ef33d0d616429515a9ce1f6c9af28b13a6a59ef4a384b9834d0846b4d28f593857cffacda2ac04abe67ffe7ca8f 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
6563f09d331048f402dc0c54e8be48ff701fe14316ad48c301a75368414f3cf1fb0e3ed706090fff70db6879b390c05bf2ed504206c1e407b9cc5f7295517183 0011-libiberty-copy-PIC-objects-during-build-process.patch
6ea5e476a67a16a9e94c5ed8040d1af4ebce4b417a22c97be978ff6fc91f7a627a35fc077c8ce7f5fdf0d20712001622abdccb117a7ffa789f9a90cf23cd1429 0012-libgcc_s.patch
53f96185583ca048010e759eb364ee646ebb1728379da4a7f6137a2009a3657f3d166cb9bfae78994070dd3750859a29857dfc6420bd9accebf629e259c096c2 0013-nopie.patch
d181e399bd2bdcbbbb69767ba08220d69ac97cd05faf2e1172266a1e194cf32ca3ff3a6bc29751223ecf9d2d739f6fca66dc825d4026ea6a272d39d98e038e2e 0014-ada-fix-shared-linking.patch
c08339b2f2c2840471f0ff7270d372ec5613113432c507519c3805df97215955532f53e5d9f4ca1ec345199fe7701c5e4fc1054b2bdac998c21add01feeaf94a 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
2ee36af2e4bcd1d7b9bba588d638f618359a3c60fca8939311f1e837551522fa1a6911175dfd87c56dcb4d42de8b04af65afc882ddcec215ee5f2a8c086ee399 0016-add-fortify-headers-paths.patch
af71729e9c21aaf13ab0ba9407b3be4b4e9c6b515a8e65686628ddd885ff6b69f8f31c714ce52b7c5a5c9b9d1f31070e6a4278b5d5d11868f152258002077355 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
dc37f213776957bd704caf481189063589e8ed7a223421a0489553421d45249e7425147755e344c4d172b35b329a2d191b420fd1cdd49de99546b874e5fbcd3d 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
4c9500ff6d479f84ce1ee9c043db4434b51b0f847914f78482e2fba915d0018bb19fb92882b3df8475cb70171183089115ce95c0e87f69c05e56d1e3b94262be 0019-aarch64-disable-multilib-support.patch
832eb922bcd8b4bd510929de520ea036734316c55c222a3323b3df26923ce599a8580586e7922860db7ecd2a0c7d9d15213daa1ae7f7026fe8ec8eac5ca29f32 0020-s390x-disable-multilib-support.patch
fe99502b6c12b923774486dfba7480959708722ca56690e8b601c7f774f074a21f8f3ff1a0b39ca0b88ebaa2b5773652f6c9fdf92d7f78a3e674038dcb98c5a6 0021-ppc64-le-disable-multilib-support.patch
50160fdacd1eb2696a87c63955308b07c21bf9ce5b085e74fdcc3db633cbe705e84e9d37bc124dfdbfd89980026533c2ca5a537fdfa3edfdcb46d50625df53ea 0022-x86_64-disable-multilib-support.patch
498fda16a87f11f802c4910a4e1cd8c02b6e302cccfc60588749a170e4729ac5054a1ae253772baf82854767659eedc07c5e6ae0e154b3ff24dc57a017de9f20 0023-riscv-disable-multilib-support.patch
c846962e05062e036dd6b5d107cadb9aa33019ca555936394605911de8a3b5a145f03cc59b393b2a42f7b8ded5712c80583d27c8ac4eec145dcd688a5dfc8b81 0024-always-build-libgcc_eh.a.patch
e476823a735ed41a1220b06e74c56312cd98077c4c4a06bc8af4875a25c197d3d38b0666765c2ed5b5e5d1c5093d456caf19cab5eb57cfb841797873d4fefe28 0025-ada-libgnarl-compatibility-for-musl.patch
1a120d66233b5becd89f1042252d43327aab975ccdfd06480f11f79e306bd9ac4869d7483bd2bf9a8125426bf01582f3f2524eec5d7ab4d762e7d7829070be01 0026-ada-musl-support-fixes.patch
1290e17df57e549e1de7431473389210102841e42bbafceeef5e69ec258ed4eb5a4fb2aa4ba1ccb66496833335412495000fd8be6c74b4edd633af352a54e10b 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
39c6604aaa6e931f507b804c1d3443d59edfd66d4ba8774b02fd6d30937c85a645575ab7921c3c8ee5d51d65a76290b47319c5f0276fd4fb5319f1e94e875160 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
b3be6955a078ace099dceeb48535ab41ff47c79963822c93741f50823e0239e4aff26566e4abc9d2c3964f65bc7d61bf081398c5e6c4ba009db8d5d60dc8de10 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
028e67e52aa6ae31dadd9da4d235e780832e9a114d2ffb72b452dac81f80851bcbb652429c760daf70e07edfb80589953bf780b670313b367cc72877cc3d16e5 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
3d845c1684fb4286f9e8a57df860db9a9eb18296d6e54e09b53d33bce67b2529995b6611584eef7e37fd506c20ec1f9f839f107678614b1d1cde675a084495cc 0031-druntime-link-against-libucontext-on-all-platforms.patch
4929eeeb0ea962ca3d8d5bf00334bb520c4419a31940d79244bd8a75cf9a5ac53d60aed4728404c463bb4a82070f0224887281207f4f8f2e532f312c5071098b 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
97890297608a6f2926b9628321f3e27b5a86ca9f33933f66c9d2d4c441f4ed219867fbc18c2f51ad4e427ba799bd0ad7ff6927d0869ef9e1d594b72ad793657b 0033-fix-assert-in-__deregister_frame_info_bases.patch
"

View file

@ -1,14 +1,14 @@
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
From a695388351636049500bd1f014caed177c2123c3 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
Subject: [PATCH 01/33] 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 3b2e4f47915..20f790904a2 100644
index 3527283693b..c4071b64b53 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@ -37,3 +37,6 @@ index 3b2e4f47915..20f790904a2 100644
return __ptr;
else
return NULL;
--
2.40.1

View file

@ -1,7 +1,7 @@
From dd1e75ff4ecda96957465b34681f245e818928bd Mon Sep 17 00:00:00 2001
From 41a1d0593acc2b24fb57bfec98a4328342b616da Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH] gcc: poison-system-directories
Subject: [PATCH 02/33] 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
@ -26,10 +26,10 @@ Upstream-Status: Pending
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 8a0dafc522d..0357868e22c 100644
index 862c474d3c8..64c4277c991 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -710,6 +710,10 @@ Wreturn-local-addr
@@ -711,6 +711,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
@ -41,10 +41,10 @@ index 8a0dafc522d..0357868e22c 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 64c27c9cfac..f0fbf123aa8 100644
index 4cad077bfbe..0679fbbf4c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -230,6 +230,12 @@
@@ -236,6 +236,12 @@
#endif
@ -58,10 +58,10 @@ index 64c27c9cfac..f0fbf123aa8 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 5ce0557719a..e9060112384 100755
index c7b26d1927d..8c46369f73f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@ -69,7 +69,7 @@ index 5ce0557719a..e9060112384 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1785,6 +1786,8 @@ Optional Features:
@@ -1788,6 +1789,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@ -78,7 +78,7 @@ index 5ce0557719a..e9060112384 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@ -99,10 +99,10 @@ index 5ce0557719a..e9060112384 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..75a7048045c 100644
index 09082e8ccae..5504bf6eb01 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@ -120,37 +120,37 @@ index 23bee7010a3..75a7048045c 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 07b440190c3..b2de464798a 100644
index 36ed1591440..4ff3e817c23 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -8029,6 +8030,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
-Wparentheses -Wno-pedantic-ms-format
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
+-Wno-poison-system-directories
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
-Wrestrict -Wno-return-local-addr -Wreturn-type
-Wno-scalar-storage-order -Wsequence-point
@@ -8423,6 +8424,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.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+@item -Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
@item -Wfloat-equal
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..47fb5802194 100644
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
@@ -1146,6 +1146,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}}} \
@ -160,7 +160,7 @@ index bb07cc244e3..47fb5802194 100644
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
@ -198,3 +198,6 @@ index bd2a97938eb..c80f100f476 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.40.1

View file

@ -1,7 +1,7 @@
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
From a15c0e1514fb5fa5609ad7abc6c5f5d0749d0c4a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
Subject: [PATCH 03/33] specs: turn on -Wl,-z,now by default
Previously, we also used to turn on -z relro here, but we now build
binutils with --enable-relro, which is functionally equivalent.
@ -14,24 +14,24 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b2de464798a..83bd1bde433 100644
index 4ff3e817c23..b1877a751aa 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -17958,6 +17958,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,now} is used. To disable, use @option{-Wl,-z,nonow}.
+
@item -u @var{symbol}
@opindex u
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 47fb5802194..d18b5d7b59a 100644
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
@ -39,3 +39,6 @@ index 47fb5802194..d18b5d7b59a 100644
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.40.1

View file

@ -1,8 +1,8 @@
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
From edb757265420be9c5a903827bedf46b02c09d868 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0
Subject: [PATCH 04/33] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
ObjC, ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.cc | 4 ++++
@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
index 98f5aef2af9..d4da19e4014 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1545,6 +1545,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
@ -25,10 +25,10 @@ index 4672ae8486a..573c021e1e8 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 83bd1bde433..dda299a9987 100644
index b1877a751aa..91d384e1927 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
@@ -11865,6 +11865,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.
@ -38,6 +38,9 @@ index 83bd1bde433..dda299a9987 100644
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.40.1

View file

@ -1,8 +1,8 @@
From 75d1a35180cf0967f062765314bf091a64032062 Mon Sep 17 00:00:00 2001
From dda9ee88db09aadab7585fa33aca67f1702df190 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
but always link the sanitizer libraries with --no-as-needed.
Subject: [PATCH 05/33] On linux targets pass --as-needed by default to the
linker, but always link the sanitizer libraries with --no-as-needed.
---
gcc/config/aarch64/aarch64-linux.h | 1 +
@ -22,7 +22,7 @@ Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
14 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 5e4553d79f5..b516f3ef97f 100644
index 4277f03da2a..b131983a546 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
@ -34,7 +34,7 @@ index 5e4553d79f5..b516f3ef97f 100644
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index 17f16a55910..9ec667e9a5e 100644
index 03f783f2ad1..d946e700dda 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
@ -47,7 +47,7 @@ index 17f16a55910..9ec667e9a5e 100644
%{shared:-shared} \
%{!shared: \
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index df3da67c4f0..7532bc29f9b 100644
index 7b7b7cbbe14..49c050c6f2c 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
@ -59,7 +59,7 @@ index df3da67c4f0..7532bc29f9b 100644
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 857c0e077bf..8433e56c3e1 100644
index eda8010b133..b26b17f2f2a 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -69,9 +69,9 @@ index 857c0e077bf..8433e56c3e1 100644
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBHWASAN_EARLY_SPEC
#define LIBHWASAN_EARLY_SPEC "%{static-libhwasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
"%{static-libhwasan:%{!shared:" \
@@ -146,12 +146,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
@ -87,7 +87,7 @@ index 857c0e077bf..8433e56c3e1 100644
#undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index 0102b2a6f3b..994414c1845 100644
index a79b739089d..e0752673dff 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
@ -100,7 +100,7 @@ index 0102b2a6f3b..994414c1845 100644
%{!static: \
%{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index abc8cf624ca..fe656aeae27 100644
index 3b63b99acf6..759bf0db86f 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -112,7 +112,7 @@ index abc8cf624ca..fe656aeae27 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 93510098ccc..3813e536423 100644
index 5dfd428aa17..02656dad7fc 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
@ -125,7 +125,7 @@ index 93510098ccc..3813e536423 100644
%{!shared: \
%{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index 6aad7192e69..e1256a55add 100644
index a4e5380b589..3cc61bce69f 100644
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
@ -137,7 +137,7 @@ index 6aad7192e69..e1256a55add 100644
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 38803723ba9..3067ed6eac8 100644
index b9557a75dc7..d8d1450f346 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
@ -149,7 +149,7 @@ index 38803723ba9..3067ed6eac8 100644
%{mno-relax:--no-relax} \
%{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index b2a7afabc73..34ceb4e4fce 100644
index 9e457033d11..08016bf224d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -377,13 +377,13 @@ extern int dot_symbols;
@ -169,10 +169,10 @@ index b2a7afabc73..34ceb4e4fce 100644
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 7e2519de5d4..61215a7a1b3 100644
index ae932fc22f0..c8ff0c6dc8e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -788,7 +788,7 @@ GNU_USER_TARGET_CC1_SPEC
@@ -780,7 +780,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
@ -182,7 +182,7 @@ index 7e2519de5d4..61215a7a1b3 100644
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index d7b7e7a7b02..d2287f14f2e 100644
index 02aa1edaff8..64df5801134 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see
@ -195,7 +195,7 @@ index d7b7e7a7b02..d2287f14f2e 100644
%{!shared: \
%{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 6a809e9092d..93bfb92d3ff 100644
index 0e33b3cac2c..c2f44546e62 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@ -208,10 +208,10 @@ index 6a809e9092d..93bfb92d3ff 100644
%{!shared: \
%{!static: \
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index d18b5d7b59a..3b76311b544 100644
index f82fae23c22..da6417dd0d1 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -744,8 +744,11 @@ proper position among the other output files. */
@@ -754,8 +754,11 @@ proper position among the other output files. */
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -225,7 +225,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -780,8 +783,11 @@ proper position among the other output files. */
@@ -790,8 +793,11 @@ proper position among the other output files. */
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -239,7 +239,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -798,8 +804,11 @@ proper position among the other output files. */
@@ -808,8 +814,11 @@ proper position among the other output files. */
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
@ -253,7 +253,7 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -814,8 +823,11 @@ proper position among the other output files. */
@@ -824,8 +833,11 @@ proper position among the other output files. */
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
@ -267,3 +267,6 @@ index d18b5d7b59a..3b76311b544 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.40.1

View file

@ -1,17 +1,17 @@
From c664283dd30949c5299d1c45bd5740bcfe993d22 Mon Sep 17 00:00:00 2001
From 14d66aece585329970ed8a777792502baaa9606b Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
Subject: [PATCH 06/33] Enable -Wformat and -Wformat-security by default.
---
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 07da40ef43b..8683f706426 100644
index a75038930ae..b98726f33ed 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -692,7 +692,7 @@ Warn about function calls with format strings that write past the end
@@ -704,7 +704,7 @@ Warn about function calls with format strings that write past the end
of the destination region. Same as -Wformat-overflow=1.
Wformat-security
@ -20,7 +20,7 @@ index 07da40ef43b..8683f706426 100644
Warn about possible security problems with format functions.
Wformat-signedness
@@ -713,7 +713,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
@ -29,3 +29,6 @@ index 07da40ef43b..8683f706426 100644
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wformat-overflow=
--
2.40.1

View file

@ -1,17 +1,17 @@
From e4d0ec43e772b6dc7c3708aed5309897df26a125 Mon Sep 17 00:00:00 2001
From 53bedd7a7bfcc70cd518afedbf3713cbfaa1e631 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.
Subject: [PATCH 07/33] 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 0357868e22c..6d5e5eebe60 100644
index 64c4277c991..c24839d32bc 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -802,7 +802,7 @@ Common Var(warn_system_headers) Warning
@@ -803,7 +803,7 @@ Common Var(warn_system_headers) Warning
Do not suppress warnings from system headers.
Wtrampolines
@ -20,3 +20,6 @@ index 0357868e22c..6d5e5eebe60 100644
Warn whenever a trampoline is generated.
Wtrivial-auto-var-init
--
2.40.1

View file

@ -1,8 +1,8 @@
From 27e5d5bd3fed9006a2958d2b09750d15ad07383b Mon Sep 17 00:00:00 2001
From d5cecc5d699ad150c38794c6f4f231fa48cb450d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
Change the buffer size.
Subject: [PATCH 08/33] Disable ssp on -nostdlib, -nodefaultlibs and
-ffreestanding Change the buffer size.
---
gcc/gcc.cc | 8 +++++++-
@ -10,10 +10,10 @@ Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 3b76311b544..cc99d0b7aa1 100644
index da6417dd0d1..b5a6f200635 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -996,6 +996,12 @@ proper position among the other output files. */
@@ -983,6 +983,12 @@ proper position among the other output files. */
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@ -26,7 +26,7 @@ index 3b76311b544..cc99d0b7aa1 100644
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1295,7 +1301,7 @@ static const char *cc1_options =
@@ -1282,7 +1288,7 @@ static const char *cc1_options =
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
@ -36,10 +36,10 @@ index 3b76311b544..cc99d0b7aa1 100644
%{fprofile-arcs|fprofile-generate*|coverage:\
%{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index b88e1372005..82a7e25dd2f 100644
index 823cdb2ff85..5b096899b40 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1012,7 +1012,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
@@ -1006,7 +1006,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
The maximum number of SSA_NAME assignments to follow in determining a value.
-param=ssp-buffer-size=
@ -48,3 +48,6 @@ index b88e1372005..82a7e25dd2f 100644
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--
2.40.1

View file

@ -1,8 +1,8 @@
From 83bf2a316222e2fe0b72968cadf4e334d41173f6 Mon Sep 17 00:00:00 2001
From a646f903a6c04393c4c013d7bc4c979a74a0e0f9 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:50:33 +0000
Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc
bootstrapping.
Subject: [PATCH 09/33] Ensure that msgfmt doesn't encounter problems during
gcc bootstrapping.
Solves error messages like the following:
@ -26,7 +26,7 @@ https://bugs.gentoo.org/295480
2 files changed, 2 insertions(+)
diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am
index 8f51544989e..5329804d136 100644
index 12d34910830..61b13762b71 100644
--- a/libstdc++-v3/po/Makefile.am
+++ b/libstdc++-v3/po/Makefile.am
@@ -38,6 +38,7 @@ MSGFMT = msgfmt
@ -38,7 +38,7 @@ index 8f51544989e..5329804d136 100644
all-local: all-local-$(USE_NLS)
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 243f3db7b72..822210781fa 100644
index 8e93445acd2..d6ff06e5ddb 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -561,6 +561,7 @@ uninstall-am:
@ -49,3 +49,6 @@ index 243f3db7b72..822210781fa 100644
$(MSGFMT) -o $@ $<
all-local: all-local-$(USE_NLS)
--
2.40.1

View file

@ -1,14 +1,14 @@
From 190064993cd8ddbd48015c1fc1916e4110a97733 Mon Sep 17 00:00:00 2001
From 7a5b7b5c556b410074af850c6c49eb5e6ba84362 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:52:07 +0000
Subject: [PATCH] Don't declare asprintf if defined as a macro.
Subject: [PATCH 10/33] 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 a65ced9c820..eb20ab0f95f 100644
index 1d5c779fcff..19e3cb1e31c 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
@ -23,3 +23,6 @@ index a65ced9c820..eb20ab0f95f 100644
/* Like asprintf but allocates memory without fail. This works like
xmalloc. */
--
2.40.1

View file

@ -1,14 +1,14 @@
From 838e1daa955d9013c462be3471497cb39641e951 Mon Sep 17 00:00:00 2001
From b51bd406029737efbe4c93f8dbbaf797c4979215 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:00 +0000
Subject: [PATCH] libiberty: copy PIC objects during build process
Subject: [PATCH 11/33] 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 1b17c2e3a47..8db1176df2e 100644
index 72608f3e4a7..58356884728 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
@ -19,3 +19,6 @@ index 1b17c2e3a47..8db1176df2e 100644
cd ..; \
else true; fi
--
2.40.1

View file

@ -1,7 +1,7 @@
From 048c394eb709bfd216e307c1b92ac7f8a7e7758b Mon Sep 17 00:00:00 2001
From 5c0678a73c11e16853632717ced113497878b1b0 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 24 Oct 2015 20:09:53 +0000
Subject: [PATCH] libgcc_s
Subject: [PATCH 12/33] libgcc_s
---
gcc/config/i386/i386-expand.cc | 4 ++--
@ -10,10 +10,10 @@ Subject: [PATCH] libgcc_s
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 31780b6daf7..d89898846e1 100644
index 0d817fc3f3b..2e99db00db9 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
@@ -12691,10 +12691,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
{
case IX86_BUILTIN_CPU_INIT:
{
@ -27,7 +27,7 @@ index 31780b6daf7..d89898846e1 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 dab1d98060f..cf824b4114a 100644
index 50b6d8248a2..724ced402a1 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
@ -52,3 +52,6 @@ index 8506a635790..564296f788e 100644
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS)
+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS)
CRTSTUFF_T_CFLAGS += $(CET_FLAGS)
--
2.40.1

View file

@ -1,30 +0,0 @@
From 717346fbbd6642ba6b0c3af2deb3771794346507 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:53:36 +0000
Subject: [PATCH] libitm: disable FORTIFY
---
libitm/configure.tgt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libitm/configure.tgt b/libitm/configure.tgt
index 06e90973ef3..669e64236c3 100644
--- a/libitm/configure.tgt
+++ b/libitm/configure.tgt
@@ -47,6 +47,16 @@ if test "$gcc_cv_have_tls" = yes ; then
esac
fi
+# FIXME: error: inlining failed in call to always_inline
+# int vfprintf(FILE*, const char*, __va_list_tag*)
+# : function body can be overwritten at link time
+# Disable Fortify in libitm for now. #508852
+case "${target}" in
+ *-*-linux*)
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
+ ;;
+esac
+
# 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

View file

@ -1,7 +1,7 @@
From db28b1e0f3b06325026ec5b5e7cdca4e9992e05c Mon Sep 17 00:00:00 2001
From 242ee89090db9c1ad797d949fc99819dcacf2e98 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 7 Nov 2015 02:08:05 +0000
Subject: [PATCH] nopie
Subject: [PATCH 13/33] nopie
---
gcc/configure | 27 +++++++++++++++++++++++++++
@ -9,10 +9,10 @@ Subject: [PATCH] nopie
2 files changed, 40 insertions(+)
diff --git a/gcc/configure b/gcc/configure
index e9060112384..2f6b3265a6c 100755
index 8c46369f73f..e59cbee1767 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32497,6 +32497,33 @@ fi
@@ -32268,6 +32268,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 e9060112384..2f6b3265a6c 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 75a7048045c..e683d3a7a5f 100644
index 5504bf6eb01..57268319de1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7681,6 +7681,19 @@ AC_CACHE_CHECK([for -no-pie option],
@@ -7552,6 +7552,19 @@ AC_CACHE_CHECK([for -no-pie option],
LDFLAGS="$saved_LDFLAGS"])
if test "$gcc_cv_no_pie" = "yes"; then
NO_PIE_FLAG="-no-pie"
@ -70,3 +70,6 @@ index 75a7048045c..e683d3a7a5f 100644
fi
AC_SUBST([NO_PIE_FLAG])
--
2.40.1

View file

@ -1,14 +1,14 @@
From fd642f8cd61849a9dc169588be5562ceda96a889 Mon Sep 17 00:00:00 2001
From 0e273647111ae365ac5c27dee96dc18f69668eac Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:16 +0000
Subject: [PATCH] ada: fix shared linking
Subject: [PATCH 14/33] 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 a7574efb472..0ad0d66463c 100644
index f2126441208..22cfa9c641f 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib";
@ -37,3 +37,6 @@ index a7574efb472..0ad0d66463c 100644
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--
2.40.1

View file

@ -1,17 +1,17 @@
From a547632f5c7caec4a164e8d5e5b568fb7a461365 Mon Sep 17 00:00:00 2001
From 3163941fdbb16261c4617fc6a1711d0835378d16 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:59:43 +0000
Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing
Subject: [PATCH 15/33] build: fix CXXFLAGS_FOR_BUILD passing
---
Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.in b/Makefile.in
index 593495e1650..b96f60e33e2 100644
index 06a9398e172..6ff2b3f9925 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
@@ -178,6 +178,7 @@ BUILD_EXPORTS = \
# built for the build system to override those in BASE_FLAGS_TO_PASS.
EXTRA_BUILD_FLAGS = \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
@ -19,3 +19,6 @@ index 593495e1650..b96f60e33e2 100644
LDFLAGS="$(LDFLAGS_FOR_BUILD)"
# This is the list of directories to built for the host system.
--
2.40.1

View file

@ -1,21 +0,0 @@
From 686e85d8a05f9f9e6c983afb13f937bd88fe84dd Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:18:32 +0000
Subject: [PATCH] dlang: use libucontext on mips64
---
libphobos/configure.tgt | 1 +
1 file changed, 1 insertion(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 0063dd23249..c5e782a1238 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes

View file

@ -1,17 +1,17 @@
From 5bd37f8ee93a0fe1a3f841f48ed6626e7e0aa19d Mon Sep 17 00:00:00 2001
From 157c80f27b5a9404c8f86e016d590ef7b691bc70 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths
Subject: [PATCH 16/33] 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 74f70793d90..61b07f319f6 100644
index e3aca79cccc..b3537b8fbeb 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -172,6 +172,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifdef NATIVE_SYSTEM_HEADER_DIR
#define INCLUDE_DEFAULTS_MUSL_NATIVE \
@ -20,3 +20,6 @@ index 74f70793d90..61b07f319f6 100644
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
{ NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
#else
--
2.40.1

View file

@ -1,9 +1,9 @@
From d2577dc78a1f159e5c41fd0b53e73fa0e264cb52 Mon Sep 17 00:00:00 2001
From da159d71a8f2844a653fd5cdb320aeeed99aadd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 21 Aug 2020 07:03:00 +0000
Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
it unconditionally, as otherwise we get link failures if some objects are
-fstack-protector built and final link happens with -fno-stack-protector.
Subject: [PATCH 17/33] 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.
@ -13,10 +13,10 @@ Subject: [PATCH] Alpine musl package provides libssp_nonshared.a. We link to
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index cc99d0b7aa1..c60a75371f8 100644
index b5a6f200635..6cbb726599b 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1004,8 +1004,7 @@ proper position among the other output files. */
@@ -991,8 +991,7 @@ proper position among the other output files. */
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
@ -26,3 +26,6 @@ index cc99d0b7aa1..c60a75371f8 100644
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \
--
2.40.1

View file

@ -1,7 +1,7 @@
From bbd5c529ef878c2d6096fd4949616714eb82683a Mon Sep 17 00:00:00 2001
From 78e41f066281892aa353cf2df61d1dc9e60af23a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:03:42 +0000
Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
Subject: [PATCH 18/33] DP: Use --push-state/--pop-state for gold as well when
linking libtsan.
---
@ -9,10 +9,10 @@ Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c60a75371f8..735b2b1bba1 100644
index 6cbb726599b..59390fd39d6 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -745,10 +745,10 @@ proper position among the other output files. */
@@ -755,10 +755,10 @@ proper position among the other output files. */
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
@ -25,7 +25,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -784,10 +784,10 @@ proper position among the other output files. */
@@ -794,10 +794,10 @@ proper position among the other output files. */
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
@ -38,7 +38,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -805,10 +805,10 @@ proper position among the other output files. */
@@ -815,10 +815,10 @@ proper position among the other output files. */
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
@ -51,7 +51,7 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -824,10 +824,10 @@ proper position among the other output files. */
@@ -834,10 +834,10 @@ proper position among the other output files. */
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
@ -64,3 +64,6 @@ index c60a75371f8..735b2b1bba1 100644
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.40.1

View file

@ -1,7 +1,7 @@
From 8fc8d6c26a2a45945182e211bc3ac2eae4d6a11b Mon Sep 17 00:00:00 2001
From 59e1be27072008d0c42e0315332a8bdcf7cdaefc Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:12:55 +0000
Subject: [PATCH] aarch64: disable multilib support
Subject: [PATCH 19/33] aarch64: disable multilib support
multilib is unsupported on Alpine GCC
---
@ -9,7 +9,7 @@ multilib is unsupported on Alpine GCC
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
index d0cd546002a..b63a77f4969 100644
index 57bf4100fcd..172894b57ef 100644
--- a/gcc/config/aarch64/t-aarch64-linux
+++ b/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
@ -21,3 +21,6 @@ index d0cd546002a..b63a77f4969 100644
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--
2.40.1

View file

@ -1,7 +1,7 @@
From 65ad898df141261a1ccd891a99133ad8f9847133 Mon Sep 17 00:00:00 2001
From a03f39ffea2bc204beaef1f0dfb8bab41efeb49f Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:13:59 +0000
Subject: [PATCH] s390x: disable multilib support
Subject: [PATCH 20/33] s390x: disable multilib support
multilib is not supported on Alpine GCC at present
---
@ -20,3 +20,6 @@ index cc6ab367072..7f498ee1cdc 100644
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
--
2.40.1

View file

@ -1,45 +0,0 @@
From 714ed6d9649bf9ed42e34fef9c41169921e63921 Mon Sep 17 00:00:00 2001
From: Nils Andreas Svee <me@lochnair.net>
Date: Thu, 21 Dec 2017 03:14:33 +0100
Subject: [PATCH] mips64: disable multilib support
multilib is not supported by Alpine GCC
---
gcc/config/mips/mips.h | 8 ++++----
gcc/config/mips/t-linux64 | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 858bbba3a36..2d4f553e652 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3447,11 +3447,11 @@ struct GTY(()) machine_function {
/* If we are *not* using multilibs and the default ABI is not ABI_32 we
need to change these from /lib and /usr/lib. */
#if MIPS_ABI_DEFAULT == ABI_N32
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#elif MIPS_ABI_DEFAULT == ABI_64
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
+#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
/* 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 2fdd8e00407..406a3676289 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib \
+ ../lib32 \
+ ../lib

View file

@ -1,7 +1,7 @@
From 3263d8634da6d7e1edb1bfd88e1b2627ce0aa1be Mon Sep 17 00:00:00 2001
From fceb9cfebae070da1b07c5dbc915d2ea128bfb7d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:33 +0000
Subject: [PATCH] ppc64[le]: disable multilib support
Subject: [PATCH 21/33] ppc64[le]: disable multilib support
multilib is not presently supported on Alpine GCC
---
@ -36,7 +36,7 @@ index 4e371255533..128c75c7d39 100644
endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index 47e0efd5764..f89729af64f 100644
index 01a94242308..b3a76379c03 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -28,8 +28,8 @@
@ -76,3 +76,6 @@ index 2e63bdb9fc9..c6e1c5db65d 100644
+MULTILIB_OSDIRNAMES := m64=../lib
+MULTILIB_OSDIRNAMES += m32=../lib32
MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN}
--
2.40.1

View file

@ -1,7 +1,7 @@
From bf63353ea679e0bbf2c2f17bb64c75ebd590c6e7 Mon Sep 17 00:00:00 2001
From f79c1c2b5634ac59e120bc1130ba5584e7120623 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Thu, 6 Jan 2022 03:14:54 +0000
Subject: [PATCH] x86_64: disable multilib support
Subject: [PATCH 22/33] x86_64: disable multilib support
multilib is not presently supported on Alpine GCC
---
@ -9,7 +9,7 @@ multilib is not presently supported on Alpine GCC
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index 5526ad0e6cc..78866afab36 100644
index 138956b0962..bc03dab874f 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -33,6 +33,6 @@
@ -21,3 +21,6 @@ index 5526ad0e6cc..78866afab36 100644
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--
2.40.1

View file

@ -1,7 +1,7 @@
From 2eed19787020ce52cf07b76a5d167c420ec42b61 Mon Sep 17 00:00:00 2001
From f1fb56b945fc7fc649d78a2f73bfe98f1377c814 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Mon, 3 Jan 2022 07:14:48 +0100
Subject: [PATCH] riscv: disable multilib support
Subject: [PATCH 23/33] riscv: disable multilib support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -43,7 +43,7 @@ library.
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3067ed6eac8..4c8c85e3285 100644
index d8d1450f346..a386bba87d7 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -71,9 +71,3 @@ along with GCC; see the file COPYING3. If not see
@ -69,3 +69,6 @@ index 216d2776a18..1a8a863853e 100644
+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES)))
MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc
--
2.40.1

View file

@ -1,7 +1,7 @@
From 51a35c0fa0e793c6a2c64ae1449c0cfd681d8f8a Mon Sep 17 00:00:00 2001
From b3d43777021f3c61def29d3764e8ee05ebb3c520 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:05:41 +0000
Subject: [PATCH] always build libgcc_eh.a
Subject: [PATCH 24/33] always build libgcc_eh.a
highly inspired by:
http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
@ -10,10 +10,10 @@ highly inspired by:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 09b3ec8bc2e..c9ca58c64cc 100644
index 6c4dc79ab71..023cede18a7 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -957,8 +957,9 @@ ifneq ($(LIBUNWIND),)
@@ -960,8 +960,9 @@ ifneq ($(LIBUNWIND),)
all: libunwind.a
endif
@ -24,7 +24,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
@@ -1160,10 +1161,6 @@ install-libunwind:
@@ -1163,10 +1164,6 @@ install-libunwind:
install-shared:
$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
@ -35,7 +35,7 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
$(subst @multilib_dir@,$(MULTIDIR),$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
@@ -1180,6 +1177,10 @@ ifeq ($(enable_gcov),yes)
@@ -1183,6 +1180,10 @@ ifeq ($(enable_gcov),yes)
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
endif
@ -46,3 +46,6 @@ index 09b3ec8bc2e..c9ca58c64cc 100644
parts="$(INSTALL_PARTS)"; \
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
--
2.40.1

View file

@ -1,7 +1,7 @@
From 64a1c5f57e278869f41c43ee56cc5defb3dd55c5 Mon Sep 17 00:00:00 2001
From c33ad45cabb27512ec7f4e8f7e40cf448f4db59d Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:06:30 +0000
Subject: [PATCH] ada: libgnarl compatibility for musl
Subject: [PATCH 25/33] ada: libgnarl compatibility for musl
---
gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------
@ -9,7 +9,7 @@ Subject: [PATCH] ada: libgnarl compatibility for musl
2 files changed, 3 insertions(+), 61 deletions(-)
diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads
index 7c9e7ca4518..caafc4aa68f 100644
index a5e645d334d..32165347071 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -403,12 +403,6 @@ package System.OS_Interface is
@ -38,7 +38,7 @@ index 7c9e7ca4518..caafc4aa68f 100644
sched_priority : int; -- scheduling priority
end record;
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 4ff784f0ea7..b34a12802c6 100644
index 821ceef30e4..ae95b58e01e 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
@ -130,3 +130,6 @@ index 4ff784f0ea7..b34a12802c6 100644
Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access);
pragma Assert (Result in 0 | ENOMEM);
--
2.40.1

View file

@ -1,7 +1,7 @@
From 82addb1312f4f58a412a664228944009aa5cb569 Mon Sep 17 00:00:00 2001
From 3169e4c52c248f21a084ef5b540201c982e61d35 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:07:48 +0000
Subject: [PATCH] ada: musl support fixes
Subject: [PATCH 26/33] ada: musl support fixes
---
gcc/ada/Makefile.rtl | 10 +++++-----
@ -11,10 +11,10 @@ Subject: [PATCH] ada: musl support fixes
4 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index aaf853e3a2a..e2dd3587ed5 100644
index 96306f8cc9a..090b6770ae5 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1633,7 +1633,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
@@ -1549,7 +1549,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),)
s-intman.adb<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -23,7 +23,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2258,7 +2258,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2174,7 +2174,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
s-tasinf.adb<libgnarl/s-tasinf__linux.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -32,7 +32,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2289,7 +2289,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@ -41,7 +41,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2504,7 +2504,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
@@ -2420,7 +2420,7 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(target_cpu) $(target_os))),)
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
$(TRASYM_DWARF_UNIX_PAIRS) \
@ -50,7 +50,7 @@ index aaf853e3a2a..e2dd3587ed5 100644
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
@@ -2608,7 +2608,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(target_cpu) $(target_os))),)
@@ -2524,7 +2524,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) \
@ -58,9 +58,9 @@ index aaf853e3a2a..e2dd3587ed5 100644
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(X86_64_TARGET_PAIRS) \
$(GNATRTL_128BIT_PAIRS) \
$(SIMD_PATH_TARGET_PAIRS) \
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 591d033fbca..a485cbf15b9 100644
index 8522094164e..92b230a462b 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -91,6 +91,11 @@
@ -75,7 +75,7 @@ index 591d033fbca..a485cbf15b9 100644
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
@@ -3446,7 +3451,6 @@ __gnat_lwp_self (void)
@@ -3438,7 +3443,6 @@ __gnat_lwp_self (void)
#endif
#if defined (__linux__)
@ -83,7 +83,7 @@ index 591d033fbca..a485cbf15b9 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
@@ -3456,7 +3460,7 @@ __gnat_lwp_self (void)
@@ -3448,7 +3452,7 @@ __gnat_lwp_self (void)
/* Dynamic cpu sets */
@ -92,7 +92,7 @@ index 591d033fbca..a485cbf15b9 100644
__gnat_cpu_alloc (size_t count)
{
return CPU_ALLOC (count);
@@ -3469,33 +3473,33 @@ __gnat_cpu_alloc_size (size_t count)
@@ -3461,33 +3465,33 @@ __gnat_cpu_alloc_size (size_t count)
}
void
@ -134,7 +134,7 @@ index 591d033fbca..a485cbf15b9 100644
}
size_t
@@ -3505,23 +3509,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
@@ -3497,23 +3501,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED)
}
void
@ -164,10 +164,10 @@ index 591d033fbca..a485cbf15b9 100644
#endif /* !CPU_ALLOC */
#endif /* __linux__ */
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 2631be5ad3e..d442f4bd6cd 100644
index 987432c9307..4d782f07de9 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -321,13 +321,11 @@ extern void *__gnat_lwp_self (void);
@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@ -186,10 +186,10 @@ index 2631be5ad3e..d442f4bd6cd 100644
#if defined (_WIN32)
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
index 32d30a49c7e..d960e32e2d0 100644
index c0ee4a16bb1..ed796a48c1b 100644
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1132,7 +1132,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1127,7 +1127,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
/* 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)
@ -198,7 +198,7 @@ index 32d30a49c7e..d960e32e2d0 100644
3- openpty (USE_OPENPTY)
When using the cloning device method, the macro USE_CLONE_DEVICE should
@@ -1146,7 +1146,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
@@ -1141,7 +1141,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
@ -207,7 +207,7 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
@@ -1195,8 +1195,8 @@ allocate_pty_desc (pty_desc **desc) {
@@ -1190,8 +1190,8 @@ allocate_pty_desc (pty_desc **desc) {
int master_fd = -1;
char *slave_name = NULL;
@ -218,3 +218,6 @@ index 32d30a49c7e..d960e32e2d0 100644
#elif defined (USE_OPENPTY)
status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
#elif defined (USE_CLONE_DEVICE)
--
2.40.1

View file

@ -1,7 +1,7 @@
From 573a66e4146c9a65d895af9081a4d3d49cfc9e7a Mon Sep 17 00:00:00 2001
From 944dead3994c1a9bab757ad61e836e2317b8aa30 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
Date: Wed, 9 Dec 2020 07:42:06 +0000
Subject: [PATCH 27/33] configure: Add --enable-autolink-libatomic, use in
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
This fixes issues with RISC-V.
@ -9,19 +9,19 @@ This fixes issues with RISC-V.
Makefile.in | 1 +
gcc/config.in | 6 ++++++
gcc/config/gnu-user.h | 12 +++++++++++-
gcc/configure | 32 ++++++++++++++++++++++++++++++--
gcc/configure.ac | 22 +++++++++++++++++++++-
gcc/configure | 31 ++++++++++++++++++++++++++++++-
gcc/configure.ac | 21 +++++++++++++++++++++
gcc/doc/install.texi | 8 ++++++++
gcc/doc/tm.texi | 8 +++++++-
gcc/doc/tm.texi.in | 8 +++++++-
gcc/gcc.cc | 12 +++++++++++-
9 files changed, 102 insertions(+), 7 deletions(-)
9 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b564ddbf792..a95c7407d16 100644
index 6ff2b3f9925..394b105b271 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -232,6 +232,7 @@ HOST_EXPORTS = \
@@ -235,6 +235,7 @@ HOST_EXPORTS = \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@ -30,7 +30,7 @@ index b564ddbf792..a95c7407d16 100644
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
diff --git a/gcc/config.in b/gcc/config.in
index f0fbf123aa8..af84efc4f9e 100644
index 0679fbbf4c6..ee81139b385 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -118,6 +118,12 @@
@ -47,7 +47,7 @@ index f0fbf123aa8..af84efc4f9e 100644
format instead of DPD */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8433e56c3e1..0347f10da8b 100644
index b26b17f2f2a..3f64ea46180 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -71,10 +71,10 @@ index 8433e56c3e1..0347f10da8b 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/configure b/gcc/configure
index 2f6b3265a6c..6dc65bf4ccb 100755
index e59cbee1767..787c35d4e25 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -981,6 +981,7 @@ with_changes_root_url
@@ -984,6 +984,7 @@ with_changes_root_url
enable_languages
with_multilib_list
with_multilib_generator
@ -82,7 +82,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
with_zstd
with_zstd_include
with_zstd_lib
@@ -1710,6 +1711,9 @@ Optional Features:
@@ -1713,6 +1714,9 @@ Optional Features:
--disable-shared don't provide a shared libgcc
--disable-gcov don't provide libgcov and related host tools
--enable-languages=LIST specify which front-ends to build
@ -92,7 +92,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
--disable-rpath do not hardcode runtime library paths
--enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling
@@ -8324,7 +8328,6 @@ else
@@ -8329,7 +8333,6 @@ else
fi
@ -100,7 +100,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# Check whether --with-multilib-generator was given.
if test "${with_multilib_generator+set}" = set; then :
withval=$with_multilib_generator; :
@@ -8332,6 +8335,32 @@ else
@@ -8337,6 +8340,32 @@ else
with_multilib_generator=default
fi
@ -133,16 +133,11 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# -------------------------
# Checks for other programs
@@ -34296,4 +34325,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e683d3a7a5f..07c81c78336 100644
index 57268319de1..56bcaa87620 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1205,6 +1205,27 @@ AC_ARG_WITH(multilib-generator,
@@ -1199,6 +1199,27 @@ AC_ARG_WITH(multilib-generator,
:,
with_multilib_generator=default)
@ -170,16 +165,11 @@ index e683d3a7a5f..07c81c78336 100644
# -------------------------
# Checks for other programs
# -------------------------
@@ -7839,4 +7860,3 @@ done
],
[subdirs='$subdirs'])
AC_OUTPUT
-
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 48408d842db..c90be0ee750 100644
index 928fc6b6d4b..81a677014df 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2295,6 +2295,14 @@ files, but these changed header paths may conflict with some compilation
@@ -2374,6 +2374,14 @@ files, but these changed header paths may conflict with some compilation
environments. Enabled by default, and may be disabled using
@option{--disable-canonical-system-headers}.
@ -195,7 +185,7 @@ index 48408d842db..c90be0ee750 100644
Tell GCC that when the GNU C Library (glibc) is used on the target it
will be version @var{major}.@var{minor} or later. Normally this can
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c5006afc00d..56b62c69ae8 100644
index a660e33739b..6183c407a2b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -214,7 +204,7 @@ index c5006afc00d..56b62c69ae8 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index f869ddd5e5b..57c93f24ac3 100644
index f7ab5d48a63..281540aba68 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -233,10 +223,10 @@ index f869ddd5e5b..57c93f24ac3 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 735b2b1bba1..f10f3c91aa7 100644
index 59390fd39d6..dae1dd4cf79 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,13 +987,23 @@ proper position among the other output files. */
@@ -974,13 +974,23 @@ proper position among the other output files. */
# define ASM_DEBUG_OPTION_SPEC ""
#endif
@ -261,3 +251,6 @@ index 735b2b1bba1..f10f3c91aa7 100644
#endif
#ifdef ENABLE_DEFAULT_SSP
--
2.40.1

View file

@ -1,8 +1,8 @@
From 4baaeb9661fa4015d9701e3616ce1ad4e8a07fd8 Mon Sep 17 00:00:00 2001
From 8ce637988d0c463544c6b95e3a543380854fb73c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 29 Aug 2021 09:45:27 +0200
Subject: [PATCH] configure: fix detection of atomic builtins in libatomic
configure script
Date: Sun, 29 Aug 2021 12:23:34 +0200
Subject: [PATCH 28/33] configure: fix detection of atomic builtins in
libatomic configure script
Alpine's --enable-autolink-libatomic (which is enabled for riscv64 by
default) causes the libatomic configure script to incorrectly detect
@ -22,7 +22,7 @@ See:
1 file changed, 20 insertions(+)
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index 33f8c91ce77..3999db2cf8a 100644
index a92ae9e8309..90b579ca4d8 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -30,6 +30,26 @@
@ -52,3 +52,6 @@ index 33f8c91ce77..3999db2cf8a 100644
case "${target_cpu}" in
alpha*)
# fenv.c needs this option to generate inexact exceptions.
--
2.40.1

View file

@ -1,15 +1,15 @@
From 20c84de53efcb86993f1a1909e65a97240d6123e Mon Sep 17 00:00:00 2001
From 2f005ed8d54415aa609e3b5ade3ef80bb04f0cf4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Thu, 30 Jun 2022 17:08:36 +0000
Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl
targets
Date: Thu, 30 Jun 2022 16:44:51 +0000
Subject: [PATCH 29/33] libstdc++: do not throw exceptions for non-C locales on
musl targets
---
libstdc++-v3/config/locale/generic/c_locale.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index 1e4db8d4415..9b79bc3c5dd 100644
index 8849d78fdfa..aff467f98fe 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
@ -22,3 +22,6 @@ index 1e4db8d4415..9b79bc3c5dd 100644
}
void
--
2.40.1

View file

@ -1,7 +1,8 @@
From b6554d1207d0f5771c2f5d11316b61787e4dd705 Mon Sep 17 00:00:00 2001
From 65f85fc6750b5d6735f7688c832244ffca2b8ab1 Mon Sep 17 00:00:00 2001
From: Mathias LANG <pro.mathias.lang@gmail.com>
Date: Mon, 17 Jan 2022 16:31:09 +0000
Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext
Date: Mon, 17 Jan 2022 03:49:21 +0000
Subject: [PATCH 30/33] gdc: unconditionally link libgphobos against
libucontext
ref: alpine/aports#13422
---
@ -9,10 +10,10 @@ ref: alpine/aports#13422
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index a95c7407d16..ea942d60387 100644
index 394b105b271..bc4a77fc300 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53287,7 +53287,7 @@ configure-target-libphobos:
@@ -52809,7 +52809,7 @@ configure-target-libphobos:
esac; \
module_srcdir=libphobos; \
rm -f no-such-file || : ; \
@ -21,3 +22,6 @@ index a95c7407d16..ea942d60387 100644
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--
2.40.1

View file

@ -1,7 +1,7 @@
From 39f5c9a850917a3c19630c0115ef0d5b0f151c72 Mon Sep 17 00:00:00 2001
From 1c7088d3182fac082706bfa9ec3864291b91b2b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 16 Jul 2022 13:26:49 +0200
Subject: [PATCH] druntime: link against libucontext on all platforms
Date: Sat, 16 Jul 2022 09:21:11 +0200
Subject: [PATCH 31/33] druntime: link against libucontext on all platforms
On musl-based Linux distributions, swapcontext etc. are not provided by
musl but instead by libucontext. Hence, we _always_ need to link against
@ -12,10 +12,10 @@ an external library for these functions.
2 files changed, 16 deletions(-)
diff --git a/libphobos/configure b/libphobos/configure
index 9da06f087d0..0db0acfb9c2 100755
index 925c53c5f5e..60c2a0c11c6 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -15192,14 +15192,6 @@ fi
@@ -15216,14 +15216,6 @@ fi
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
@ -49,3 +49,6 @@ index 45a56f6f76a..fef6e890b1e 100644
if test "$druntime_fiber_asm_external" = no; then
AC_SEARCH_LIBS([swapcontext], [c ucontext], [],
AC_MSG_ERROR([swapcontext required but not found]))
--
2.40.1

View file

@ -1,14 +1,14 @@
From 4b28b8356c7ecf9375a2c07ac6be226a5693f8d2 Mon Sep 17 00:00:00 2001
From 5dd552d33be47ea3b7586df7dc4812b2cd3b0a5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Tue, 19 Jul 2022 01:05:11 +0200
Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc
Date: Tue, 19 Jul 2022 14:54:07 +0200
Subject: [PATCH 32/33] libgnat: time_t is always 64-bit on musl libc
---
gcc/ada/libgnat/s-parame.ads | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads
index 4b8111402ba..b670e78c53b 100644
index 3d6e345a1ba..cfe0b4d3ca6 100644
--- a/gcc/ada/libgnat/s-parame.ads
+++ b/gcc/ada/libgnat/s-parame.ads
@@ -102,7 +102,7 @@ package System.Parameters is
@ -20,3 +20,6 @@ index 4b8111402ba..b670e78c53b 100644
-- Number of bits in type time_t
----------------------------------------------
--
2.40.1

View file

@ -0,0 +1,39 @@
From 2f41b10437653f7dfee027dc623a94ac4054773c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 14 May 2023 19:30:21 +0200
Subject: [PATCH 33/33] fix assert in __deregister_frame_info_bases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The assertion in __deregister_frame_info_bases assumes that for every
frame something was inserted into the lookup data structure by
__register_frame_info_bases. Unfortunately, this does not necessarily
hold true as the btree_insert call in __register_frame_info_bases will
not insert anything for empty ranges. Therefore, we need to explicitly
account for such empty ranges in the assertion as `ob` will be a null
pointer for such ranges, hence causing the assertion to fail.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
---
libgcc/unwind-dw2-fde.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
index 7b74c391ced..8683a65aa02 100644
--- a/libgcc/unwind-dw2-fde.c
+++ b/libgcc/unwind-dw2-fde.c
@@ -278,7 +278,9 @@ __deregister_frame_info_bases (const void *begin)
__gthread_mutex_unlock (&object_mutex);
#endif
- gcc_assert (in_shutdown || ob);
+ // If we didn't find anything in the lookup data structures then they
+ // were either already destroyed or we tried to remove an empty range.
+ gcc_assert (in_shutdown || ((range[1] - range[0]) == 0 || ob));
return (void *) ob;
}
--
2.40.1

View file

@ -1,101 +0,0 @@
From ecc2a2e70e44fa76a75b12d0893bc1702b72a1b4 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Mon, 19 Dec 2022 10:37:06 -0800
Subject: [PATCH] libgo: check for makecontext in -lucontext
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patch from Sören Tempel.
Change-Id: I74b4052cc7aca19224afd6d9a2739c3fae46b722
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/458396
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/configure | 57 ++++++++++++++++++++++++++++++++++++++++++++++
libgo/configure.ac | 3 +++
2 files changed, 60 insertions(+)
diff --git a/libgo/configure b/libgo/configure
index 460fdad7..a607dbff 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -14818,6 +14818,63 @@ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing makecontext" >&5
+$as_echo_n "checking for library containing makecontext... " >&6; }
+if ${ac_cv_search_makecontext+:} 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 makecontext ();
+int
+main ()
+{
+return makecontext ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' 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_makecontext=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_makecontext+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_makecontext+:} false; then :
+
+else
+ ac_cv_search_makecontext=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_makecontext" >&5
+$as_echo "$ac_cv_search_makecontext" >&6; }
+ac_res=$ac_cv_search_makecontext
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
$as_echo_n "checking for library containing sched_yield... " >&6; }
if ${ac_cv_search_sched_yield+:} false; then :
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 09554a37..a59aa091 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -570,6 +570,9 @@ PTHREAD_LIBS=
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
+dnl Test if -lucontext is required for makecontext.
+AC_SEARCH_LIBS([makecontext], [ucontext])
+
dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
AC_SEARCH_LIBS([sched_yield], [rt])
AC_SEARCH_LIBS([nanosleep], [rt])

View file

@ -1,204 +0,0 @@
From b3840bdcc0eee2a4d099a9af52199944ade7acb9 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Tue, 29 Nov 2022 17:28:44 -0800
Subject: [PATCH] syscall, runtime: always call XSI strerror_r
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This does the right thing for either glibc or musl on GNU/Linux.
Based on patch by Sören Tempel.
Change-Id: If2969e131f0fae456d58b35d839d8abe191fcc59
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/454176
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
---
libgo/Makefile.am | 1 +
libgo/Makefile.in | 6 +++++-
libgo/go/syscall/errstr.go | 22 ++++++++-----------
libgo/go/syscall/errstr_glibc.go | 33 ----------------------------
libgo/runtime/go-strerror.c | 37 ++++++++++++++++++++++++++++++++
5 files changed, 52 insertions(+), 47 deletions(-)
delete mode 100644 libgo/go/syscall/errstr_glibc.go
create mode 100644 libgo/runtime/go-strerror.c
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index e0a1eec5..df568743 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -465,6 +465,7 @@ runtime_files = \
runtime/go-nanotime.c \
runtime/go-now.c \
runtime/go-nosys.c \
+ runtime/go-strerror.c \
runtime/go-reflect-call.c \
runtime/go-setenv.c \
runtime/go-signal.c \
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 7bef5df9..f2f3f0fc 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -247,7 +247,7 @@ am__objects_4 = runtime/aeshash.lo runtime/go-assert.lo \
runtime/go-fieldtrack.lo runtime/go-matherr.lo \
runtime/go-memclr.lo runtime/go-memmove.lo \
runtime/go-memequal.lo runtime/go-nanotime.lo \
- runtime/go-now.lo runtime/go-nosys.lo \
+ runtime/go-now.lo runtime/go-nosys.lo runtime/go-strerror.lo \
runtime/go-reflect-call.lo runtime/go-setenv.lo \
runtime/go-signal.lo runtime/go-unsafe-pointer.lo \
runtime/go-unsetenv.lo runtime/go-unwind.lo \
@@ -917,6 +917,7 @@ runtime_files = \
runtime/go-nanotime.c \
runtime/go-now.c \
runtime/go-nosys.c \
+ runtime/go-strerror.c \
runtime/go-reflect-call.c \
runtime/go-setenv.c \
runtime/go-signal.c \
@@ -1390,6 +1391,8 @@ runtime/go-now.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-nosys.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
+runtime/go-strerror.lo: runtime/$(am__dirstamp) \
+ runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-reflect-call.lo: runtime/$(am__dirstamp) \
runtime/$(DEPDIR)/$(am__dirstamp)
runtime/go-setenv.lo: runtime/$(am__dirstamp) \
@@ -1457,6 +1460,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-reflect-call.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-setenv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-signal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-strerror.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsafe-pointer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unsetenv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@runtime/$(DEPDIR)/go-unwind.Plo@am__quote@
diff --git a/libgo/go/syscall/errstr.go b/libgo/go/syscall/errstr.go
index 6c2441d3..9f688e2a 100644
--- a/libgo/go/syscall/errstr.go
+++ b/libgo/go/syscall/errstr.go
@@ -4,23 +4,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !hurd
-// +build !linux
-
package syscall
-//sysnb strerror_r(errnum int, buf []byte) (err Errno)
-//strerror_r(errnum _C_int, buf *byte, buflen Size_t) _C_int
+import "internal/bytealg"
+
+//extern go_strerror
+func go_strerror(_C_int, *byte, Size_t) _C_int
func Errstr(errnum int) string {
- for len := 128; ; len *= 2 {
- b := make([]byte, len)
- errno := strerror_r(errnum, b)
+ for size := 128; ; size *= 2 {
+ b := make([]byte, size)
+ errno := go_strerror(_C_int(errnum), &b[0], Size_t(len(b)))
if errno == 0 {
- i := 0
- for b[i] != 0 {
- i++
- }
+ i := bytealg.IndexByte(b, 0)
// Lowercase first letter: Bad -> bad, but
// STREAM -> STREAM.
if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
@@ -29,7 +25,7 @@ func Errstr(errnum int) string {
return string(b[:i])
}
if errno != ERANGE {
- return "errstr failure"
+ return "strerror_r failure"
}
}
}
diff --git a/libgo/go/syscall/errstr_glibc.go b/libgo/go/syscall/errstr_glibc.go
deleted file mode 100644
index 5b19e6f2..00000000
--- a/libgo/go/syscall/errstr_glibc.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// errstr_glibc.go -- GNU/Linux and GNU/Hurd specific error strings.
-
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// We use this rather than errstr.go because on GNU/Linux sterror_r
-// returns a pointer to the error message, and may not use buf at all.
-
-// +build hurd linux
-
-package syscall
-
-import "unsafe"
-
-//sysnb strerror_r(errnum int, b []byte) (errstr *byte)
-//strerror_r(errnum _C_int, b *byte, len Size_t) *byte
-
-func Errstr(errnum int) string {
- a := make([]byte, 128)
- p := strerror_r(errnum, a)
- b := (*[1000]byte)(unsafe.Pointer(p))
- i := 0
- for b[i] != 0 {
- i++
- }
- // Lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
- c := b[0] + 'a' - 'A'
- return string(c) + string(b[1:i])
- }
- return string(b[:i])
-}
diff --git a/libgo/runtime/go-strerror.c b/libgo/runtime/go-strerror.c
new file mode 100644
index 00000000..13d1d91d
--- /dev/null
+++ b/libgo/runtime/go-strerror.c
@@ -0,0 +1,37 @@
+/* go-strerror.c -- wrapper around XSI-compliant strerror_r.
+
+ Copyright 2022 The Go Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style
+ license that can be found in the LICENSE file. */
+
+/* There are two version of strerror_r on GNU/Linux: a GNU-specific
+ and an XSI-compliant version. The former version is only available
+ on glibc. Since glibc 2.13, the XSI-compliant version is also
+ provided by glibc if _GNU_SOURCE is not defined. Since the
+ entirety of gofrontend is compiled with _GNU_SOURCE, this file
+ exists to selectively undefine it and provides an alias to the
+ XSI-compliant version of strerror_r(3). */
+
+#ifdef __linux__
+
+/* Force selection of XSI-compliant strerror_r by glibc. */
+#undef XOPEN_SOURCE
+#define XOPEN_SOURCE 600
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200112L
+#undef _GNU_SOURCE
+
+#endif /* __linux__ */
+
+#include <string.h>
+
+#ifndef HAVE_STRERROR_R
+// Provided by go-nosys.c if not provided by libc itself.
+extern int strerror_r (int, char *, size_t);
+#endif
+
+int
+go_strerror (int errnum, char *buf, size_t buflen)
+{
+ return strerror_r (errnum, buf, buflen);
+}

View file

@ -1,199 +0,0 @@
From 3b9243b891cc06373639a23ed5717b0d1c2d8ea6 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Tue, 14 Jun 2022 06:13:43 -0700
Subject: [PATCH] libgo: permit loff_t and off_t to be macros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
They are macros in musl libc, rather than typedefs, and -fgo-dump-spec
doesn't handle that case.
Based on patch by Sören Tempel.
Change-Id: Ic9a608fd964a6f78e754aa8e3100aff06ab3dade
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/412075
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
libgo: #include <sys/types.h> when checking for loff_t
Fixes https://gcc.gnu.org/PR106033
Fixes golang/go#53469
Change-Id: I060021b7bb9334949b567442448abb6822fd6d35
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413214
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/config.h.in | 3 +++
libgo/configure | 12 ++++++++++--
libgo/configure.ac | 11 +++++++++--
libgo/go/syscall/libcall_linux.go | 17 +++++++++--------
libgo/mksysinfo.sh | 6 +-----
libgo/sysinfo.c | 15 ++++++++++++++-
6 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/libgo/config.h.in b/libgo/config.h.in
index 25b8ab8f9ee..2c3c7469675 100644
--- a/libgo/config.h.in
+++ b/libgo/config.h.in
@@ -70,6 +70,9 @@
/* Define to 1 if you have the `fchownat' function. */
#undef HAVE_FCHOWNAT
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
/* Define to 1 if you have the `futimesat' function. */
#undef HAVE_FUTIMESAT
diff --git a/libgo/configure b/libgo/configure
index ffe17c9be55..61a49947eb9 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -15249,7 +15249,7 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
-for ac_header in port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h
+for ac_header in fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -15546,7 +15546,14 @@ _ACEOF
fi
-ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "$ac_includes_default"
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "
+#include <sys/types.h>
+#include <fcntl.h>
+
+"
if test "x$ac_cv_type_loff_t" = xyes; then :
cat >>confdefs.h <<_ACEOF
@@ -15556,6 +15563,7 @@ _ACEOF
fi
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 7e2b98ba67c..274fcfc35c7 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -579,7 +579,7 @@ AC_C_BIGENDIAN
GCC_CHECK_UNWIND_GETIPINFO
-AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
+AC_CHECK_HEADERS(fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
[#include <netinet/in.h>
@@ -601,7 +601,14 @@ AC_STRUCT_DIRENT_D_TYPE
AC_CHECK_FUNCS(accept4 dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat open64 openat pipe2 removexattr renameat setxattr sync_file_range splice syscall tee unlinkat unshare utimensat)
AC_TYPE_OFF_T
-AC_CHECK_TYPES([loff_t])
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+AC_CHECK_TYPES([loff_t], [], [], [[
+#include <sys/types.h>
+#include <fcntl.h>
+]])
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 96974bd3269..65eb1a745f7 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -209,19 +209,20 @@ func Gettid() (tid int) {
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
-//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
+//sys splice(rfd int, roff *_libgo_loff_t_type, wfd int, woff *_libgo_loff_t_type, len int, flags int) (n int64, err error)
+//splice(rfd _C_int, roff *_libgo_loff_t_type, wfd _C_int, woff *_libgo_loff_t_type, len Size_t, flags _C_uint) Ssize_t
+
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
- var lroff _loff_t
- var plroff *_loff_t
+ var lroff _libgo_loff_t_type
+ var plroff *_libgo_loff_t_type
if roff != nil {
- lroff = _loff_t(*roff)
+ lroff = _libgo_loff_t_type(*roff)
plroff = &lroff
}
- var lwoff _loff_t
- var plwoff *_loff_t
+ var lwoff _libgo_loff_t_type
+ var plwoff *_libgo_loff_t_type
if woff != nil {
- lwoff = _loff_t(*woff)
+ lwoff = _libgo_loff_t_type(*woff)
plwoff = &lwoff
}
n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 0c52ea5d71a..5aa309155c3 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -403,11 +403,7 @@ fi
# Some basic types.
echo 'type Size_t _size_t' >> ${OUT}
echo "type Ssize_t _ssize_t" >> ${OUT}
-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
- echo "type Offset_t _off64_t" >> ${OUT}
-else
- echo "type Offset_t _off_t" >> ${OUT}
-fi
+echo "type Offset_t _libgo_off_t_type" >> ${OUT}
echo "type Mode_t _mode_t" >> ${OUT}
echo "type Pid_t _pid_t" >> ${OUT}
echo "type Uid_t _uid_t" >> ${OUT}
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index 336a5983750..fc0210992fa 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,18 @@ enum {
};
#endif
+#if defined(HAVE_LOFF_T)
+// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
+// see a typedef.
+typedef loff_t libgo_loff_t_type;
+#endif
+
+#if defined(HAVE_OFF64_T)
+typedef off64_t libgo_off_t_type;
+#else
+typedef off_t libgo_off_t_type;
+#endif
+
// The following section introduces explicit references to types and
// constants of interest to support bootstrapping libgo using a
// compiler that doesn't support -fdump-go-spec (e.g., clang), via
@@ -534,7 +546,8 @@ SREF(timex);
// From sys/types.h
TREF(pid_t);
TREF(off_t);
-TREF(loff_t);
+TREF(libgo_loff_t_type);
+TREF(libgo_off_t_type);
TREF(size_t);
TREF(ssize_t);
TREF(mode_t);

View file

@ -1,59 +0,0 @@
From 5e658f4659c551330ea68f5667e4f951b218f32d Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 26 Oct 2022 17:23:42 -0700
Subject: [PATCH] runtime: use _libgo_off_t_type when calling C mmap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The last argument to the C mmap function is type off_t, not uintptr.
On some 32-bit systems, off_t is larger than uintptr.
Based on patch by Sören Tempel.
Change-Id: Ib6f9d5bcd4734f99a72889e2282b97ec3c8fbd34
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/445735
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/go/runtime/mem_gccgo.go | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go
index fa3389d8..1e84f4f5 100644
--- a/libgo/go/runtime/mem_gccgo.go
+++ b/libgo/go/runtime/mem_gccgo.go
@@ -15,7 +15,7 @@ import (
//go:linkname sysFree
//extern mmap
-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
+func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off _libgo_off_t_type) unsafe.Pointer
//extern munmap
func munmap(addr unsafe.Pointer, length uintptr) int32
@@ -38,7 +38,7 @@ func init() {
}
func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
- p := sysMmap(addr, n, prot, flags, fd, off)
+ p := sysMmap(addr, n, prot, flags, fd, _libgo_off_t_type(off))
if uintptr(p) == _MAP_FAILED {
return nil, errno()
}
@@ -47,6 +47,7 @@ func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (u
// Don't split the stack as this method may be invoked without a valid G, which
// prevents us from allocating more stack.
+//
//go:nosplit
func sysAlloc(n uintptr, sysStat *sysMemStat) unsafe.Pointer {
p, err := mmap(nil, n, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, mmapFD, 0)
@@ -165,6 +166,7 @@ func sysHugePage(v unsafe.Pointer, n uintptr) {
// Don't split the stack as this function may be invoked without a valid G,
// which prevents us from allocating more stack.
+//
//go:nosplit
func sysFree(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
sysStat.add(-int64(n))

View file

@ -1,71 +0,0 @@
From c86b726c048eddc1be320c0bf64a897658bee13d Mon Sep 17 00:00:00 2001
From: Uros Bizjak <ubizjak@gmail.com>
Date: Wed, 18 May 2022 20:03:26 +0200
Subject: [PATCH] x86: Fix -fsplit-stack feature detection via
TARGET_CAN_SPLIT_STACK
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since commit c163647ffbc9a20c8feb6e079dbecccfe016c82e -fsplit-stack
is only supported on glibc targets. However, this original commit
required some fixups. As part of the fixup, the changes to the
gnu-user-common.h and gnu.h were partially reverted in commit
60953a23d57b13a672f751bec0c6eefc059eb1ab thus causing TARGET_CAN_SPLIT_STACK
to be defined for non-glibc targets even though -fsplit-stack is
actually not supported and attempting to use it causes a runtime error.
This causes gcc internal code, such as ./gcc/go/gospec.c to not
correctly detect that -fsplit-stack is not supported and thus causes
gccgo to fail compilation on non-glibc targets.
This commit ensures that TARGET_CAN_SPLIT_STACK is only set if the
default libc is glibc. It is presently unclear to me if there is a
better way to detect glibc at pre-processor time.
The proposed changes have been tested on x86 and x86_64 Alpine Linux
(which uses musl libc) and fix compilation of gccgo for this target.
Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
gcc/ChangeLog:
* config/i386/gnu-user-common.h (defined): Only define
TARGET_CAN_SPLIT_STACK for glibc targets.
* config/i386/gnu.h (defined): Ditto.
---
gcc/config/i386/gnu-user-common.h | 5 +++--
gcc/config/i386/gnu.h | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 23b54c5be52..cab9be2bfb7 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -66,7 +66,8 @@ along with GCC; see the file COPYING3. If not see
#define STACK_CHECK_STATIC_BUILTIN 1
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if (DEFAULT_LIBC == LIBC_GLIBC) && HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 401e60c9a02..fb8d69a97d8 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -41,8 +41,9 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
#define TARGET_THREAD_SSP_OFFSET 0x14
/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+ assembler has full support for the CFI directives. Also
+ we only support -fsplit-stack on glibc targets. */
+#if (DEFAULT_LIBC == LIBC_GLIBC) && HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
#define TARGET_CAN_SPLIT_STACK
#endif
/* We steal the last transactional memory word. */

View file

@ -1,41 +0,0 @@
From 548720bca6bff21ebc9aba22249d9ce45bbd90c7 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 29 Jun 2022 15:32:04 -0700
Subject: [PATCH] libgo: handle stat st_atim32 field and SYS_SECCOMP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patches for musl support, from Sören Tempel.
Fixes https://gcc.gnu.org/PR105225
Change-Id: If396877d4a4c7d27962226d7a6e3bb91b1344413
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415294
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/mksysinfo.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 5aa30915..ea1fa17d 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -127,6 +127,7 @@ fi
# The syscall numbers. We force the names to upper case.
grep '^const _SYS_' gen-sysinfo.go | \
+ grep -v '^const _SYS_SECCOMP = ' | \
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
while read sys; do
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
@@ -506,7 +507,7 @@ fi
# For historical reasons Go uses the suffix "timespec" instead of "tim" for
# stat_t's time fields on NetBSD.
-st_times='-e s/st_atim/Atim/ -e s/st_mtim/Mtim/ -e s/st_ctim/Ctim/'
+st_times='-e s/st_atim/Atim/g -e s/st_mtim/Mtim/g -e s/st_ctim/Ctim/g'
if test "${GOOS}" = "netbsd"; then
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi

View file

@ -1,108 +0,0 @@
From 8f1a91aeff400d572857895b7f5e863ec5a4d93e Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Mon, 26 Sep 2022 15:03:53 -0400
Subject: [PATCH] runtime: portable access to sigev_notify_thread_id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously, libgo relied on the _sigev_un implementation-specific
field in struct sigevent, which is only available on glibc.
This patch uses the sigev_notify_thread_id macro instead which is
mandated by timer_create(2). In theory, this should work with any libc
implementation for Linux. Unfortunately, there is an open glibc bug
as glibc does not define this macro. For this reason, a glibc-specific
workaround is required. Other libcs (such as musl) define the macro
and don't require the workaround.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27417
This makes libgo compatible with musl libc.
Based on patch by Sören Tempel.
Change-Id: I0924a53d5212730ebc395ecf9199f85967be8cc6
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/434755
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
---
libgo/go/runtime/os_linux.go | 12 +++++++++++-
libgo/runtime/go-signal.c | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/libgo/go/runtime/os_linux.go b/libgo/go/runtime/os_linux.go
index 96fb1788..2b2d827c 100644
--- a/libgo/go/runtime/os_linux.go
+++ b/libgo/go/runtime/os_linux.go
@@ -22,6 +22,12 @@ type mOS struct {
profileTimerValid uint32
}
+// setSigeventTID is written in C to set the sigev_notify_thread_id
+// field of a sigevent struct.
+//
+//go:noescape
+func setSigeventTID(*_sigevent, int32)
+
func getProcID() uint64 {
return uint64(gettid())
}
@@ -52,9 +58,12 @@ const (
)
// Atomically,
+//
// if(*addr == val) sleep
+//
// Might be woken up spuriously; that's allowed.
// Don't sleep longer than ns; ns < 0 means forever.
+//
//go:nosplit
func futexsleep(addr *uint32, val uint32, ns int64) {
// Some Linux kernels have a bug where futex of
@@ -73,6 +82,7 @@ func futexsleep(addr *uint32, val uint32, ns int64) {
}
// If any procs are sleeping on addr, wake up at most cnt.
+//
//go:nosplit
func futexwakeup(addr *uint32, cnt uint32) {
ret := futex(unsafe.Pointer(addr), _FUTEX_WAKE_PRIVATE, cnt, nil, nil, 0)
@@ -365,7 +375,7 @@ func setThreadCPUProfiler(hz int32) {
var sevp _sigevent
sevp.sigev_notify = _SIGEV_THREAD_ID
sevp.sigev_signo = _SIGPROF
- *((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
+ setSigeventTID(&sevp, int32(mp.procid))
ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
if ret != 0 {
// If we cannot create a timer for this M, leave profileTimerValid false
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index 528d9b6d..aa1b6305 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -183,6 +183,24 @@ setSigactionHandler(struct sigaction* sa, uintptr handler)
sa->sa_sigaction = (void*)(handler);
}
+#ifdef __linux__
+
+// Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=27417
+#ifndef sigev_notify_thread_id
+ #define sigev_notify_thread_id _sigev_un._tid
+#endif
+
+void setSigeventTID(struct sigevent*, int32_t)
+ __asm__ (GOSYM_PREFIX "runtime.setSigeventTID");
+
+void
+setSigeventTID(struct sigevent *sev, int32_t v)
+{
+ sev->sigev_notify_thread_id = v;
+}
+
+#endif // defined(__linux__)
+
// C code to fetch values from the siginfo_t and ucontext_t pointers
// passed to a signal handler.

View file

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

View file

@ -1,36 +0,0 @@
From d53e8a0e94e34dc609e34dd5e404debda2640cfb Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Sat, 30 Jul 2022 07:29:28 -0700
Subject: [PATCH] libgo: use SYS_timer_settime32
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Musl defines SYS_timer_settime32, not SYS_timer_settime, on 32-bit systems.
Based on patch by Sören Tempel.
Change-Id: I1f3485028d132ceca1aba595325af24b4d72b894
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/420222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
---
libgo/sysinfo.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index fc021099..180f5c31 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,11 @@ enum {
};
#endif
+#if !defined(SYS_timer_settime) && defined(SYS_timer_settime32)
+// musl defines SYS_timer_settim32 on 32-bit systems.
+#define SYS_timer_settime SYS_timer_settime32
+#endif
+
#if defined(HAVE_LOFF_T)
// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
// see a typedef.

View file

@ -1,50 +0,0 @@
From a62f20ae78ddd41be682dde8cab075ca4f5dbb2a Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Fri, 22 Jul 2022 11:38:20 -0700
Subject: [PATCH] libgo: use POSIX shell arithmetic expansion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Avoid bash-specific ((expression)) syntax. As the bash syntax
converts a non-zero value to a zero status (and a zero value to a 1
status), and POSIX arithmetic expansion does not, we have to negate
the result.
Based on patch by Sören Tempel.
Change-Id: I4c64fa15de3994a1a5c7c5ec0de6a82ddd858917
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/419154
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/match.sh | 2 +-
libgo/testsuite/gotest | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgo/match.sh b/libgo/match.sh
index 7ed587ff..e5ed98de 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -111,7 +111,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((!($line)))
}
matched=
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 04e4267f..0a0a7e14 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -302,7 +302,7 @@ gobuild() {
if test "$goarch" != "386"; then
line=$(echo "$line" | sed -e "s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
fi
- (($line))
+ return $((!($line)))
}
case "x$gofiles" in

View file

@ -1,65 +0,0 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1

View file

@ -24,15 +24,15 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-armhf
_pkgbase=12.2.1 # must match gcc/BASE-VER
_pkgsnap=20220924
_pkgbase=13.1.1 # must match gcc/BASE-VER
_pkgsnap=20230513
pkgver=${_pkgbase}_git$_pkgsnap
[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2"
[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross=""
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armhf
pkgrel=10
pkgrel=1
pkgdesc="Stage2 cross-compiler for armhf"
url="https://gcc.gnu.org"
arch="x86_64"
@ -40,10 +40,9 @@ license="GPL-2.0-or-later AND LGPL-2.1-or-later"
_gccrel=$pkgver-r$pkgrel
depends="binutils-armhf mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
# XXX: build hack to upgrade live on builders
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
subpackages="g++-armhf:gpp libstdc++-dev-armhf:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
replaces="libstdc++ binutils"
: "${LANG_CXX:=true}"
@ -77,11 +76,13 @@ if [ "$CHOST" != "$CTARGET" ]; then
_libatomic=false
_libitm=false
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# reset target flags (should be set in crosscreate abuild)
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/}"
unset CPPFLAGS
export CFLAGS_FOR_TARGET=" "
export CXXFLAGS_FOR_TARGET=" "
@ -89,10 +90,12 @@ if [ "$CHOST" != "$CTARGET" ]; then
STRIP_FOR_TARGET="$CTARGET-strip"
elif [ "$CBUILD" != "$CHOST" ]; then
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# fixup flags. seems gcc treats CPPFLAGS as global without
# _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/}"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/}"
unset CPPFLAGS
# reset flags and cc for build
@ -117,6 +120,21 @@ elif [ "$CBUILD" != "$CHOST" ]; then
else
STRIP_FOR_TARGET=${CROSS_COMPILE}strip
_builddir="$srcdir/build"
# format-sec: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
CPPFLAGS="${CPPFLAGS/-Werror=format-security/}"
# pass -g0 by default to bypass -g, since we don't do debug
# if -dbg added, the -g is appended and overrides this
export CFLAGS="$CPPFLAGS -g0 ${CFLAGS/-Werror=format-security/} -O2"
export CXXFLAGS="$CPPFLAGS -g0 ${CXXFLAGS/-Werror=format-security/} -O2"
unset CPPFLAGS
# https://gcc.gnu.org/install/build.html
export CFLAGS_FOR_TARGET="$CFLAGS"
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
case "$CARCH" in
@ -148,7 +166,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
*) _libquadmath=false ;;
esac
@ -225,41 +243,28 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${
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-dlang-use-libucontext-on-mips64.patch
0016-ada-fix-shared-linking.patch
0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0018-add-fortify-headers-paths.patch
0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0021-mips64-disable-multilib-support.patch
0022-aarch64-disable-multilib-support.patch
0023-s390x-disable-multilib-support.patch
0024-ppc64-le-disable-multilib-support.patch
0025-x86_64-disable-multilib-support.patch
0026-riscv-disable-multilib-support.patch
0027-always-build-libgcc_eh.a.patch
0028-ada-libgnarl-compatibility-for-musl.patch
0029-ada-musl-support-fixes.patch
0033-gcc-go-link-to-libucontext.patch
0034-Use-generic-errstr.go-implementation-on-musl.patch
0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
0045-druntime-link-against-libucontext-on-all-platforms.patch
0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
0012-libgcc_s.patch
0013-nopie.patch
0014-ada-fix-shared-linking.patch
0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
0016-add-fortify-headers-paths.patch
0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
0019-aarch64-disable-multilib-support.patch
0020-s390x-disable-multilib-support.patch
0021-ppc64-le-disable-multilib-support.patch
0022-x86_64-disable-multilib-support.patch
0023-riscv-disable-multilib-support.patch
0024-always-build-libgcc_eh.a.patch
0025-ada-libgnarl-compatibility-for-musl.patch
0026-ada-musl-support-fixes.patch
0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
0031-druntime-link-against-libucontext-on-all-platforms.patch
0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0033-fix-assert-in-__deregister_frame_info_bases.patch
"
# we build out-of-tree
@ -358,11 +363,7 @@ build() {
echo " hash_style_configure=$_hash_style_configure"
echo ""
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2"
export CPPFLAGS="$CPPFLAGS -O2"
local version="Alpine $pkgver-r$pkgrel"
local version="Alpine $pkgver"
local gccconfiguration="
--prefix=/usr
--mandir=/usr/share/man
@ -371,6 +372,7 @@ build() {
--host=$CHOST
--target=$CTARGET
--enable-checking=release
--disable-cet
--disable-fixed-point
--disable-libstdcxx-pch
--disable-multilib
@ -381,6 +383,8 @@ build() {
--enable-default-pie
--enable-default-ssp
--enable-languages=$_languages
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
$_cross_configure
@ -553,6 +557,7 @@ libcxx_dev() {
replaces="g++"
amove usr/${_target:+$CTARGET/}lib/libstdc++.a \
usr/${_target:+$CTARGET/}lib/libstdc++exp.a \
usr/${_target:+$CTARGET/}lib/libstdc++.so \
usr/${_target:+$CTARGET/}lib/libstdc++fs.a \
usr/${_target:+$CTARGET/}lib/libsupc++.a \
@ -763,52 +768,48 @@ gnat() {
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
}
gdb() {
pkgdesc="$pkgdesc (gdb printers)"
install_if="$pkgname=$pkgver-r$pkgrel gdb"
amove \
usr/share/gdb/python/ \
usr/share/gcc-*/python/
}
sha512sums="
ba4d9e73d108088da26fbefe18d9b245b76771ffe752c2b4b31bdf38a2d0b638fbc115c377526c27311d4d7ffd4e0d236a5af5016bd364ccaa11a4989d1401e8 gcc-12-20220924.tar.xz
41cbb4d69218006cf9e0cdb6c86212ef451f8decd52a50a7dbb4d34726009da7a4e0261c852b46cb584db253a4bae2f31dc485c506cb545e64a7d26e0ba6c2b6 0001-posix_memalign.patch
531155055cda7f119bcac6479bcae73af9201cd596af9cf1616850bbcf4393b91c5de9f2fbbc1cde6e158fb4df7237b033146f662dff5fa0ea12151cc514adb8 0002-gcc-poison-system-directories.patch
c1275d77b5269386a2ec683933570810f5a2ba1208c161ed887797eb9aee3cb82ef08a8964635902614e6a6e83f3065ba0801c9355d85dd8d60cb1fa20bdf687 0003-specs-turn-on-Wl-z-now-by-default.patch
a54e45bff4484a35d3826435a414d909281453f5605f4081cf3be1f15336cceed93a1d8a54e92e2fa97188623e3030ca1323d7749141e228a7db73795230d86a 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
ad132ddbd0c33a3983e3de4f74d8fdb8cb1ddf53ef54de0a5c12efb49e42014ed117165d43f396bcf3455ecfe2c8620e0326e73b4160a370a4cc92d213329c34 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
0b9ce0f130a7b797770f3d58a5200575f20e5663c86c0c5710718b7bffd3416cc2f05861613d9c258428e9541c6e0b9837d01f0c99d383e2c3de0503a988e861 0006-Enable-Wformat-and-Wformat-security-by-default.patch
e7813acc7ead61373c212cefbe53eb020b4c5bd8f0f35ee972e0524060713f911624f5a1a871feada642e1f3f5e48c8508125ca2da09de351d544bedf1d44ada 0007-Enable-Wtrampolines-by-default.patch
d0d0566a11e4828bdd6f53346a9a6b9841f3066d3f4a05ee2b6fe97aeb4552654170e7662318ea18fc777c3e75c88a067097478fc4e880a3f9c134b8a3af2277 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
f75e63d9d933874f18fb7f55b135c60dfa0377abafa8e0edb91b85d5f00f4f072d0a338ba5d9baec18494211dbbda8068782830dbafbb37068936f76aede270f 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
afa4daba222a19569588736a8276dc7c12223a7c222f3dd3795dc3f1cd90f40b90518971ae27b358020354f89562c9680ec8b8e24e85e6d4f8e54e79d185359b 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
79dac82249fb573ec477e1451a33883302eb63a5110853faed117f5021221f2153e2ec845dd5a0043b1bf9f0e5736ef0c89743ff2d771774a281c8b24542803a 0011-libiberty-copy-PIC-objects-during-build-process.patch
b035f85c1703b45d15c1d1ffe7d23400e01625e5d403504911cc92f740b02586447de2a9d66a9f80f12b9c227bc193e2a43942c8af2bdb42cdeff8272bbe6068 0012-libitm-disable-FORTIFY.patch
9fb4d396a9493d2d68fe829ce075ba4c5df148b1d6aaab315a6f8ccbdd70d0e052a5dc50369adc2dab005b4a3becd1504b182faed6e82c86accb95f5bc2b9f50 0013-libgcc_s.patch
f82ac22961d842c9f8e731a601bb255918cc160969888363ad2d83e2ccf08b19114a200d46bcf99d097bf530f470c2b1e71e46828bc1b9fff5469ff945f541d8 0014-nopie.patch
6527dc9d250db48d56cf01e9299461bf22a838ffda96c40d448e18f457b206cec2322275d2d5abbbaf3c6573c5e7eba12724c9691b601f118ff7520e19726373 0015-dlang-use-libucontext-on-mips64.patch
6c3ce0ccd68b19e2c76172d8f24b0747ee0af2b8de7af692f2f699848267d7fc42fec8e5c303102fe05be7e934b56f21eea17ce47c8aca20570590830d88e9b0 0016-ada-fix-shared-linking.patch
7089a96aaec8e0b222cb3fa7301d71bb2e328a24dec33e15ea9e3e7695bcae919308249b9a3be5ea2f3b1f069f9fd1739066f31d12317fcdab0596dba9ca54a4 0017-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
b7ebdeee0b143052fdd6e3efa070ea8621d4fb729312cbc787d618e666b593990a20cd9044a786265970d8e09ec13da03b797009543d0b657b0fe924f2dcaa68 0018-add-fortify-headers-paths.patch
8e682893d6367732ab8c490b915112a68d98855deec3bd8db91dc0d9bf486b8c044b13ee2b95c4806da7ac17c41034e081b7a66861018274cb33fdb2fd6df04a 0019-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
a14c5f98ade5af8cd6e3a0244752674d9c4f6dadb4260f98f1949bff51ac1211a3f8319e0f933f776e98998d2c7221004f92413f97ccc2e966f8462ed6d33597 0020-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
28c1d477da79aa212ac79e4b02cf865d8b9c31cec6c42f41b4268e3f3c49bf67fb51e54180abe543a54e550788bb472bfcf1b4bc38d072a792d7403dbbee178a 0021-mips64-disable-multilib-support.patch
0920e31c46bf937b47a0602766f042d45adb71abf332ee84399c665c12298ef115cff945fe26d646b0276bfdfdd04913970e6f1f8784a11c26e15111c854643d 0022-aarch64-disable-multilib-support.patch
e4c6bf7ec40f2798c8e5b40a543aecffd5591a2805546b3b97aaa4fbe4df6ce4330a60973a9ddfbca9890590606d5204e7f653ab2b6e4b2c13feeb595b68e63a 0023-s390x-disable-multilib-support.patch
0e956d793c94283ce5af7fe84bfcbb655585a9573608e9bf497fa7b726e12daa391e44977d0a8c97fb460aba89b1773b91e036b0ee1ef4d6263a3943cb63d9cd 0024-ppc64-le-disable-multilib-support.patch
95917fcb60dbc0a8134db9beb583f3c9ea61128499c214f594c434ec8246641ec41e245ce2d1d9b85ffd40ea0e5764f7a33c5522b2547145814245ac0fa25025 0025-x86_64-disable-multilib-support.patch
b40d7e4712c035674c993bbb55475290ec14523b3f0fd05493514bac4e9adaa6641faf815fc40ffc00119d9fd64be28218ee874c289ec7430eeef05ab2fcae5e 0026-riscv-disable-multilib-support.patch
674360ce2ee9f704d0632cc98756f9fe8dd8ca30064fb9d3423b437f7e679c1c51e765b15e535dcb278cd2769583690acb3395b91e4fd5f6f4e3b97879fcc313 0027-always-build-libgcc_eh.a.patch
f060687adcd5297124e4000f1ba1e3fd5d7d124da04d948cbd0d4a6c69a90a2b29a4a0dbbe13a83ab6950724f434de012b681bdbcdf53c0100b40fe3d00f2f2f 0028-ada-libgnarl-compatibility-for-musl.patch
5160bae68e20a1966c1f6d655ee98af759e9b9ee842718ae6007d467b418e1cf3b307528a0841477b5259671ce868521b06c0f2e947b7b8f3a398c53dd978252 0029-ada-musl-support-fixes.patch
72631fbef4843d6ada52f3173b257e027605866a3faf1d8e34438cbf2581952f97bf6f9569ee44fcd7c4b3b337612eaeb0612fb2e6451903f219e4d99bf719db 0033-gcc-go-link-to-libucontext.patch
141c0428f988cbd102000d4db8d4150485f6da5c064469493ea378cd579bed99330658f41fe106c0d07d1c1aa436ec3f864403ed1ba79f791a1d727b42d46910 0034-Use-generic-errstr.go-implementation-on-musl.patch
d9ba710f770e053c8f212e821817c188091a829658050b9ab5906388553ec60fec37943ea43c270e92a9014902949f3c98fc4639032d92b8145b375bb29e193e 0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
ab90d8fdd977d6cd3da096a1c76d77be3e89a020b2127247771711a32eb608cceed21834ef488ab4b69bb0f408b098fdfb61630819e3d1a1e57d5af67800ee74 0036-configure-fix-detection-of-atomic-builtins-in-libato.patch
8bc6823f0b3c66f7b73d7ddb64ffa6930463285c2e9a14a2bc1882bcc4271144eaa1107d713294699caf9481648163cbf43921a2b8e4ac0d55c78a804bae8a3d 0037-libgo-Recognize-off64_t-and-loff_t-definitions-of-mu.patch
f0744c01859e67deed404c97e1870b2876935fdc467e51980373744936574c314d5d21134734c5d515e7f3cd3483ef98045b9bbcd81c568c6038fac96ffb5fa0 0039-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch
d6dc1bfb881a313d167aaa5658790b0f55eea4336c408cfc6613dd5783440dafd0d37c43031a5f3e69be40f632e38371cd4fb6e5f0494ac4ea4d7d5025d2ae02 0041-go-gospec-forcibly-disable-fsplit-stack-support.patch
684c6a6d52512b973429b6e709966439ac1e174f9e79a33d4a638b452245b457b34752b4b4034ba983f6a712f86522e7adf715bab00a6603f64a12139c5b1e39 0042-gcc-go-fix-build-error-with-SYS_SECCOMP.patch
25014dfa99d96ee70ce0ad22e9f7974f0a51cc50b3b9c2db49df50774c8cd29e497ceed120486bee50be83bfb07f2009ed310eb9b0543f2795bd7359b87eadd2 0043-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
75fd83ac05ab0a08d5f48547b08810f9934209bc78b5db59d65f33887b382af7ec24d8a29d40f86325c05af40c1ae1ec6466c839f646af90afc895a13073d07b 0044-gdc-unconditionally-link-libgphobos-against-libucont.patch
13e047153076d6e1fc40c9f5b6bfe5699c0e5460248f3d2b35ae36677cb960525af7b0b025997e5000a8492cec5e77a86828d66b4058c0d7f89fde0ab3890142 0045-druntime-link-against-libucontext-on-all-platforms.patch
c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2101dfd4eea2a6d48bf4fae899a0ddb811c81abd7be35c122 0049-libgo-adjust-name-of-union-in-sigevent-struct.patch
179cd15d629884a66e954fd76066675efa594686b970facbb12ad50769e5d70b5530d7f61e77120e26d1c3dfc701cfc5295f341f635db998df73c41bc8e62172 0050-libphobos-don-t-define-__mode_t-twice-on-musl-target.patch
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
a82e38d273a668e4a8ad33282cb74661d125babcc6165eb0ada5da471154b2ed2894bf1fa462f0345f9d817e733b155c09a971885f3b7c04398ebcdd3b5551f5 gcc-13-20230513.tar.xz
275a71fcabc03209fe69894ee9c4bec57afabd170f08385fa148b4e481c0b2d2e5a3e2631e82551f21bc3f93c2b5299ddf39d09b88e1a5451d1cd4fb5ff3be06 0001-posix_memalign.patch
8c247b796c2cea016fe43b1c7393ed94567bd565e453fdf114d90800a86d1e5bb3761a26c9b48bccb7b3192ca482a72d02fa8b65e4703753ff8b567ddd8cb949 0002-gcc-poison-system-directories.patch
3c0773148638c41d2a45f43c8320bd9c7b1129650168f0f80bfe4cf9d00d11f352952f178c88285b5a5e47df76264304c05080b9df4948981c0d01bd7cce5cfa 0003-specs-turn-on-Wl-z-now-by-default.patch
cc81175e0e74abbb46dbc63d64c1a36fc62d4eae7ba3cc5ab85de331c31f3341fc445f3b5be7e1f53ee72e0e3a512232b821cef349a0a5991d46834d1325246e 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch
c52396a1708b1b4a29e0b5a8d2843f4ea1eb2c34fd2fd9401da0c826a1192b6f87d8b5aea7429f4811c3e293c2fef1945ac05d7c82f3ce94c84f440bb772c76e 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch
03f1ce1a6c90a438d4b953273ae31996fd54226b320f075cc5ebfe8f1c14958138922b8037774fc9a29d10c8b99303d8119a0075fbb45b608fc14f0b18ed3720 0006-Enable-Wformat-and-Wformat-security-by-default.patch
3c9f0cde600081e59e7542784839defa46e5bea7a19b9cfcfbf042f883a2a7a7547d0eeb6edea51cbb0682e20e25bde9e6597871d492cf5eaf9cfbd9475f7ce1 0007-Enable-Wtrampolines-by-default.patch
de8c97e379e9e85d57988ef3d2df2dd7f1f0a7e4e20c2bbc19f148bf3fbaccaf34e80fae8e8f60c6b9b4932135c14fd2f1a20624e44aa6d67ba92b29d36c6051 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch
acc01ac7a8da1eb02915b5b82dd539b1e8ac5045faeb6db02f54390f77a3d7a8f0cf65c2927a4150e7a52ee4a7df31091d325dd45641cc6639883defda7d0d42 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch
101ef48ce43aa084ab9875c1917388e1ae2b3ef33d0d616429515a9ce1f6c9af28b13a6a59ef4a384b9834d0846b4d28f593857cffacda2ac04abe67ffe7ca8f 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch
6563f09d331048f402dc0c54e8be48ff701fe14316ad48c301a75368414f3cf1fb0e3ed706090fff70db6879b390c05bf2ed504206c1e407b9cc5f7295517183 0011-libiberty-copy-PIC-objects-during-build-process.patch
6ea5e476a67a16a9e94c5ed8040d1af4ebce4b417a22c97be978ff6fc91f7a627a35fc077c8ce7f5fdf0d20712001622abdccb117a7ffa789f9a90cf23cd1429 0012-libgcc_s.patch
53f96185583ca048010e759eb364ee646ebb1728379da4a7f6137a2009a3657f3d166cb9bfae78994070dd3750859a29857dfc6420bd9accebf629e259c096c2 0013-nopie.patch
d181e399bd2bdcbbbb69767ba08220d69ac97cd05faf2e1172266a1e194cf32ca3ff3a6bc29751223ecf9d2d739f6fca66dc825d4026ea6a272d39d98e038e2e 0014-ada-fix-shared-linking.patch
c08339b2f2c2840471f0ff7270d372ec5613113432c507519c3805df97215955532f53e5d9f4ca1ec345199fe7701c5e4fc1054b2bdac998c21add01feeaf94a 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch
2ee36af2e4bcd1d7b9bba588d638f618359a3c60fca8939311f1e837551522fa1a6911175dfd87c56dcb4d42de8b04af65afc882ddcec215ee5f2a8c086ee399 0016-add-fortify-headers-paths.patch
af71729e9c21aaf13ab0ba9407b3be4b4e9c6b515a8e65686628ddd885ff6b69f8f31c714ce52b7c5a5c9b9d1f31070e6a4278b5d5d11868f152258002077355 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch
dc37f213776957bd704caf481189063589e8ed7a223421a0489553421d45249e7425147755e344c4d172b35b329a2d191b420fd1cdd49de99546b874e5fbcd3d 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch
4c9500ff6d479f84ce1ee9c043db4434b51b0f847914f78482e2fba915d0018bb19fb92882b3df8475cb70171183089115ce95c0e87f69c05e56d1e3b94262be 0019-aarch64-disable-multilib-support.patch
832eb922bcd8b4bd510929de520ea036734316c55c222a3323b3df26923ce599a8580586e7922860db7ecd2a0c7d9d15213daa1ae7f7026fe8ec8eac5ca29f32 0020-s390x-disable-multilib-support.patch
fe99502b6c12b923774486dfba7480959708722ca56690e8b601c7f774f074a21f8f3ff1a0b39ca0b88ebaa2b5773652f6c9fdf92d7f78a3e674038dcb98c5a6 0021-ppc64-le-disable-multilib-support.patch
50160fdacd1eb2696a87c63955308b07c21bf9ce5b085e74fdcc3db633cbe705e84e9d37bc124dfdbfd89980026533c2ca5a537fdfa3edfdcb46d50625df53ea 0022-x86_64-disable-multilib-support.patch
498fda16a87f11f802c4910a4e1cd8c02b6e302cccfc60588749a170e4729ac5054a1ae253772baf82854767659eedc07c5e6ae0e154b3ff24dc57a017de9f20 0023-riscv-disable-multilib-support.patch
c846962e05062e036dd6b5d107cadb9aa33019ca555936394605911de8a3b5a145f03cc59b393b2a42f7b8ded5712c80583d27c8ac4eec145dcd688a5dfc8b81 0024-always-build-libgcc_eh.a.patch
e476823a735ed41a1220b06e74c56312cd98077c4c4a06bc8af4875a25c197d3d38b0666765c2ed5b5e5d1c5093d456caf19cab5eb57cfb841797873d4fefe28 0025-ada-libgnarl-compatibility-for-musl.patch
1a120d66233b5becd89f1042252d43327aab975ccdfd06480f11f79e306bd9ac4869d7483bd2bf9a8125426bf01582f3f2524eec5d7ab4d762e7d7829070be01 0026-ada-musl-support-fixes.patch
1290e17df57e549e1de7431473389210102841e42bbafceeef5e69ec258ed4eb5a4fb2aa4ba1ccb66496833335412495000fd8be6c74b4edd633af352a54e10b 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
39c6604aaa6e931f507b804c1d3443d59edfd66d4ba8774b02fd6d30937c85a645575ab7921c3c8ee5d51d65a76290b47319c5f0276fd4fb5319f1e94e875160 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch
b3be6955a078ace099dceeb48535ab41ff47c79963822c93741f50823e0239e4aff26566e4abc9d2c3964f65bc7d61bf081398c5e6c4ba009db8d5d60dc8de10 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch
028e67e52aa6ae31dadd9da4d235e780832e9a114d2ffb72b452dac81f80851bcbb652429c760daf70e07edfb80589953bf780b670313b367cc72877cc3d16e5 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch
3d845c1684fb4286f9e8a57df860db9a9eb18296d6e54e09b53d33bce67b2529995b6611584eef7e37fd506c20ec1f9f839f107678614b1d1cde675a084495cc 0031-druntime-link-against-libucontext-on-all-platforms.patch
4929eeeb0ea962ca3d8d5bf00334bb520c4419a31940d79244bd8a75cf9a5ac53d60aed4728404c463bb4a82070f0224887281207f4f8f2e532f312c5071098b 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
97890297608a6f2926b9628321f3e27b5a86ca9f33933f66c9d2d4c441f4ed219867fbc18c2f51ad4e427ba799bd0ad7ff6927d0869ef9e1d594b72ad793657b 0033-fix-assert-in-__deregister_frame_info_bases.patch
"

View file

@ -1,14 +1,14 @@
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
From a695388351636049500bd1f014caed177c2123c3 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
Subject: [PATCH 01/33] 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 3b2e4f47915..20f790904a2 100644
index 3527283693b..c4071b64b53 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
@ -37,3 +37,6 @@ index 3b2e4f47915..20f790904a2 100644
return __ptr;
else
return NULL;
--
2.40.1

View file

@ -1,7 +1,7 @@
From dd1e75ff4ecda96957465b34681f245e818928bd Mon Sep 17 00:00:00 2001
From 41a1d0593acc2b24fb57bfec98a4328342b616da Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH] gcc: poison-system-directories
Subject: [PATCH 02/33] 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
@ -26,10 +26,10 @@ Upstream-Status: Pending
7 files changed, 68 insertions(+)
diff --git a/gcc/common.opt b/gcc/common.opt
index 8a0dafc522d..0357868e22c 100644
index 862c474d3c8..64c4277c991 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -710,6 +710,10 @@ Wreturn-local-addr
@@ -711,6 +711,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.
@ -41,10 +41,10 @@ index 8a0dafc522d..0357868e22c 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 64c27c9cfac..f0fbf123aa8 100644
index 4cad077bfbe..0679fbbf4c6 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -230,6 +230,12 @@
@@ -236,6 +236,12 @@
#endif
@ -58,10 +58,10 @@ index 64c27c9cfac..f0fbf123aa8 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 5ce0557719a..e9060112384 100755
index c7b26d1927d..8c46369f73f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
@@ -1026,6 +1026,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
@ -69,7 +69,7 @@ index 5ce0557719a..e9060112384 100755
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1785,6 +1786,8 @@ Optional Features:
@@ -1788,6 +1789,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
@ -78,7 +78,7 @@ index 5ce0557719a..e9060112384 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31753,6 +31756,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi
@ -99,10 +99,10 @@ index 5ce0557719a..e9060112384 100755
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..75a7048045c 100644
index 09082e8ccae..5504bf6eb01 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7292,6 +7292,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])
@ -120,37 +120,37 @@ index 23bee7010a3..75a7048045c 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 07b440190c3..b2de464798a 100644
index 36ed1591440..4ff3e817c23 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -8029,6 +8030,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -384,6 +384,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
-Wparentheses -Wno-pedantic-ms-format
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
+-Wno-poison-system-directories
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls
-Wrestrict -Wno-return-local-addr -Wreturn-type
-Wno-scalar-storage-order -Wsequence-point
@@ -8423,6 +8424,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.
+@item -Wno-poison-system-directories
+@opindex Wno-poison-system-directories
+@item -Wno-poison-system-directories
+Do not warn for @option{-I} or @option{-L} options using system
+directories such as @file{/usr/include} when cross compiling. This
+option is intended for use in chroot environments when such
+directories contain the correct headers and libraries for the target
+system rather than the host.
+
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
@item -Wfloat-equal
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..47fb5802194 100644
index 16bb07f2cdc..33b56e721d2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
@@ -1146,6 +1146,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}}} \
@ -160,7 +160,7 @@ index bb07cc244e3..47fb5802194 100644
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
index 4d44321183f..0f3f071b44c 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
@ -198,3 +198,6 @@ index bd2a97938eb..c80f100f476 100644
}
/* Use given -I paths for #include "..." but not #include <...>, and
--
2.40.1

View file

@ -1,7 +1,7 @@
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
From a15c0e1514fb5fa5609ad7abc6c5f5d0749d0c4a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
Subject: [PATCH 03/33] specs: turn on -Wl,-z,now by default
Previously, we also used to turn on -z relro here, but we now build
binutils with --enable-relro, which is functionally equivalent.
@ -14,24 +14,24 @@ now by default.
2 files changed, 4 insertions(+)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b2de464798a..83bd1bde433 100644
index 4ff3e817c23..b1877a751aa 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -17958,6 +17958,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,now} is used. To disable, use @option{-Wl,-z,nonow}.
+
@item -u @var{symbol}
@opindex u
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 47fb5802194..d18b5d7b59a 100644
index 33b56e721d2..f82fae23c22 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
@ -39,3 +39,6 @@ index 47fb5802194..d18b5d7b59a 100644
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.40.1

View file

@ -1,8 +1,8 @@
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
From edb757265420be9c5a903827bedf46b02c09d868 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0
Subject: [PATCH 04/33] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++,
ObjC, ObjC++, if the optimization level is > 0
---
gcc/c-family/c-cppbuiltin.cc | 4 ++++
@ -10,10 +10,10 @@ Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
2 files changed, 10 insertions(+)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
index 98f5aef2af9..d4da19e4014 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
@@ -1545,6 +1545,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
@ -25,10 +25,10 @@ index 4672ae8486a..573c021e1e8 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 83bd1bde433..dda299a9987 100644
index b1877a751aa..91d384e1927 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
@@ -11865,6 +11865,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.
@ -38,6 +38,9 @@ index 83bd1bde433..dda299a9987 100644
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
@item -O3
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.40.1

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