diff --git a/cross/gcc-aarch64/0001-posix_memalign.patch b/cross/gcc-aarch64/0001-posix_memalign.patch index 04240c29c..bbc2db9ca 100644 --- a/cross/gcc-aarch64/0001-posix_memalign.patch +++ b/cross/gcc-aarch64/0001-posix_memalign.patch @@ -1,14 +1,14 @@ -From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001 +From 94cf7d2b3514ed3a4401861a519ead450e022afc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/35] posix_memalign +Subject: [PATCH] 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 3527283693b..c4071b64b53 100644 +index d1d79a32fc9..069c3bb8324 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ @@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644 else return NULL; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0002-gcc-poison-system-directories.patch b/cross/gcc-aarch64/0002-gcc-poison-system-directories.patch index 9a1671267..de66b72d0 100644 --- a/cross/gcc-aarch64/0002-gcc-poison-system-directories.patch +++ b/cross/gcc-aarch64/0002-gcc-poison-system-directories.patch @@ -1,7 +1,7 @@ -From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001 +From 0d5e04099a3d2609105719f7396a4ff941b873b6 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/35] gcc: poison-system-directories +Date: Thu, 23 Jan 2025 17:12:51 -0800 +Subject: [PATCH] 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 @@ -11,23 +11,25 @@ aborted. Instead, we add the two missing items to the current scan. If the user wants this to be a failure, they can add "-Werror=poison-system-directories". +Upstream-Status: Inappropriate [OE configuration] Signed-off-by: Mark Hatle +Signed-off-by: sunil dora Signed-off-by: Khem Raj - -Upstream-Status: Pending --- gcc/common.opt | 4 ++++ - gcc/config.in | 6 ++++++ - gcc/configure | 16 ++++++++++++++++ - gcc/configure.ac | 10 ++++++++++ + gcc/config.in | 10 ++++++++++ + gcc/configure | 19 +++++++++++++++++++ + gcc/configure.ac | 16 ++++++++++++++++ gcc/doc/invoke.texi | 9 +++++++++ - gcc/gcc.cc | 2 ++ - gcc/incpath.cc | 21 +++++++++++++++++++++ - 7 files changed, 68 insertions(+) + gcc/gcc.cc | 12 ++++++++++-- + gcc/incpath.cc | 25 +++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 2 deletions(-) +diff --git a/gcc/common.opt b/gcc/common.opt +index e3fa0dacec4..bea1adc0940 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -715,6 +715,10 @@ Wreturn-local-addr +@@ -729,6 +729,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. @@ -38,9 +40,11 @@ Upstream-Status: Pending Wshadow 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 a79c51adb2b..8a531ed591c 100644 --- a/gcc/config.in +++ b/gcc/config.in -@@ -249,6 +249,12 @@ +@@ -249,6 +249,16 @@ #endif @@ -48,14 +52,20 @@ Upstream-Status: Pending +#ifndef USED_FOR_TARGET +#undef ENABLE_POISON_SYSTEM_DIRECTORIES +#endif ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef POISON_BY_DEFAULT ++#endif + + /* Define if you want all operations on RTL (the basic data structure of the 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 16965953f05..0f4a5d52c30 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1050,6 +1050,7 @@ enable_maintainer_mode +@@ -1051,6 +1051,7 @@ enable_maintainer_mode enable_link_mutex enable_link_serialization enable_version_specific_runtime_libs @@ -63,7 +73,7 @@ Upstream-Status: Pending enable_plugin enable_host_shared enable_host_pie -@@ -1823,6 +1824,8 @@ Optional Features: +@@ -1828,6 +1829,8 @@ Optional Features: --enable-version-specific-runtime-libs specify that runtime libraries should be installed in a compiler-specific directory @@ -72,7 +82,7 @@ Upstream-Status: Pending --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE -@@ -34082,6 +34085,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -83,47 +93,60 @@ Upstream-Status: Pending + enable_poison_system_directories=no +fi + -+if test "x${enable_poison_system_directories}" = "xyes"; then ++if test "x${enable_poison_system_directories}" != "xno"; then + +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++if test "$enable_poison_system_directories" = "error"; then ++$as_echo "#define POISON_BY_DEFAULT 1" >>confdefs.h ++fi + +fi + # Substitute configuration variables +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 9f67e62950a..b0e3615e5aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7555,6 +7555,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) +AC_ARG_ENABLE([poison-system-directories], + AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system header directories]),, ++ [warn for use of native system header directories (no/yes/error)]),, + [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then ++AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories]) ++if test "x${enable_poison_system_directories}" != "xno"; then ++ AC_MSG_NOTICE([poisoned directories enabled]) + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], + [1], + [Define to warn for use of native system header directories]) ++ if test $enable_poison_system_directories = "error"; then ++ AC_MSG_NOTICE([poisoned directories are fatal]) ++ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors]) ++ fi +fi + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 72009c33cd0..29aea724731 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -405,6 +405,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 -@@ -8861,6 +8862,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. + -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor + -Wno-psabi + -Wredundant-decls -Wrestrict +@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default. + Suppress warnings from casts from a pointer to an integer type of a + different size. +@opindex Wno-poison-system-directories +@item -Wno-poison-system-directories @@ -133,12 +156,27 @@ Upstream-Status: Pending +directories contain the correct headers and libraries for the target +system rather than the host. + - @opindex Wfloat-equal - @opindex Wno-float-equal - @item -Wfloat-equal + @opindex Winvalid-pch + @opindex Wno-invalid-pch + @item -Winvalid-pch +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 4fd87f2c4a1..79d4920a047 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1163,6 +1163,8 @@ proper position among the other output files. */ +@@ -909,6 +909,12 @@ proper position among the other output files. */ + #define ASM_MAP "" + #endif + ++#ifdef POISON_BY_DEFAULT ++#define POISON_IS_ERROR " -Werror=poison-system-directories" ++#else ++#define POISON_IS_ERROR ++#endif ++ + /* Assembler options for compressed debug sections. */ + #if HAVE_LD_COMPRESS_DEBUG == 0 + /* Reject if the linker cannot write compressed debug sections. */ +@@ -1166,6 +1172,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}}} \ @@ -147,6 +185,26 @@ Upstream-Status: Pending %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +@@ -1268,7 +1276,7 @@ static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ + %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR; + + /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. + +@@ -1297,7 +1305,7 @@ static const char *cc1_options = + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +- %{pthread:-fprofile-update=prefer-atomic}}}"; ++ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR; + + static const char *asm_options = + "%{-target-help:%:print-asm-header()} " +diff --git a/gcc/incpath.cc b/gcc/incpath.cc +index c1bbfd3872a..2cdbebc4c50 100644 --- a/gcc/incpath.cc +++ b/gcc/incpath.cc @@ -26,6 +26,7 @@ @@ -157,9 +215,20 @@ Upstream-Status: Pending /* Microsoft Windows does not natively support inodes. VMS has non-numeric inodes. */ -@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) +@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + cur->name, xstrerror (errno)); + reason = REASON_NOENT; + } ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ pcur = &cur->next; ++ continue; ++#endif + } + else if (!S_ISDIR (st.st_mode)) + cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0, +@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + fprintf (stderr, _("End of #embed search list.\n")); } - fprintf (stderr, _("End of search list.\n")); } + +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES @@ -168,19 +237,22 @@ Upstream-Status: Pending + struct cpp_dir *p; + + for (p = heads[INC_QUOTE]; p; p = p->next) -+ { -+ if ((!strncmp (p->name, "/usr/include", 12)) -+ || (!strncmp (p->name, "/usr/local/include", 18)) -+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) -+ || (!strncmp (p->name, "/sw/include", 11)) -+ || (!strncmp (p->name, "/opt/include", 12))) -+ warning (OPT_Wpoison_system_directories, -+ "include location \"%s\" is unsafe for " -+ "cross-compilation", -+ p->name); -+ } ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } + } +#endif } /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0003-specs-turn-on-Wl-z-now-by-default.patch b/cross/gcc-aarch64/0003-specs-turn-on-Wl-z-now-by-default.patch index 33e8b56f1..be6a3dc60 100644 --- a/cross/gcc-aarch64/0003-specs-turn-on-Wl-z-now-by-default.patch +++ b/cross/gcc-aarch64/0003-specs-turn-on-Wl-z-now-by-default.patch @@ -1,7 +1,7 @@ -From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001 +From 90e8697dd88fd99ce2cf8739e95494853005377e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default +Subject: [PATCH] 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. @@ -13,9 +13,11 @@ now by default. gcc/gcc.cc | 1 + 2 files changed, 4 insertions(+) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 29aea724731..6fb3ab70cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -18935,6 +18935,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -19477,6 +19477,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}. @@ -25,9 +27,11 @@ now by default. @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 79d4920a047..74a356fdf5e 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1161,6 +1161,7 @@ proper position among the other output files. */ +@@ -1170,6 +1170,7 @@ proper position among the other output files. */ "%{flto|flto=*:% Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, - ObjC, ObjC++, if the optimization level is > 0 +Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, + ObjC++, if the optimization level is > 0 --- gcc/c-family/c-cppbuiltin.cc | 4 ++++ gcc/doc/invoke.texi | 6 ++++++ 2 files changed, 10 insertions(+) +diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc +index 4589ee4a3a6..9edf095384c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc -@@ -1570,6 +1570,10 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -1581,6 +1581,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); @@ -22,9 +24,11 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, /* Misc. */ if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 6fb3ab70cc7..799ce073dbf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -12496,6 +12496,12 @@ also turns on the following optimization flags: +@@ -12840,6 +12840,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. @@ -37,3 +41,6 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, @opindex O3 @item -O3 Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/cross/gcc-aarch64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 819ef5e76..deb4da3dc 100644 --- a/cross/gcc-aarch64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/cross/gcc-aarch64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,8 +1,8 @@ -From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001 +From a59da582e83071de0566274d912ca6f05f4b75d0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the - linker, but always link the sanitizer libraries with --no-as-needed. +Subject: [PATCH] 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 + @@ -21,9 +21,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the gcc/gcc.cc | 28 ++++++++++++++++++++-------- 14 files changed, 36 insertions(+), 19 deletions(-) +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index 116bb4e69f3..daf99f8dce9 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h -@@ -35,6 +35,7 @@ +@@ -39,6 +39,7 @@ #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ @@ -31,6 +33,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 3fd3b831166..0b4c2dccebe 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 @@ -42,6 +46,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{O*:-O3} %{!O*:-O1} \ %{shared:-shared} \ %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index d4d389e2aa8..adccc0b11c2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -52,6 +58,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 4c4e31efa39..3c17ac6eade 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 @@ -78,6 +86,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the #endif #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index 7abfda53049..ceb8f855b7d 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 @@ -89,6 +99,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index abe714711bf..3ca128a79f5 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 @@ -99,6 +111,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index a2494c214c4..e1a5d530cdf 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -110,6 +124,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5a82508c113..6eee7cdc603 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 @@ -120,6 +136,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 9060c940a44..282c77b6a7b 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see @@ -130,6 +148,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ -X \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 0316d8cb65d..139e1b6796c 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -378,13 +378,13 @@ extern int dot_symbols; @@ -148,6 +168,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!static-pie: \ %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ +diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h +index afb5c6ad867..b64638fb25b 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -159,6 +181,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 2c3bca5dfcb..b90661247a4 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 @@ -170,6 +194,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 6d928846895..3cc05bb7240 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); @@ -181,9 +207,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!static: \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 74a356fdf5e..fc9c7d15b04 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -771,8 +771,11 @@ proper position among the other output files. */ +@@ -774,8 +774,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -197,7 +225,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -807,8 +810,11 @@ proper position among the other output files. */ +@@ -810,8 +813,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -211,7 +239,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -825,8 +831,11 @@ proper position among the other output files. */ +@@ -828,8 +834,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +253,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -841,8 +850,11 @@ proper position among the other output files. */ +@@ -844,8 +853,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 @@ -239,3 +267,6 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0006-Enable-Wformat-and-Wformat-security-by-default.patch b/cross/gcc-aarch64/0006-Enable-Wformat-and-Wformat-security-by-default.patch index b4d580f85..b8851777b 100644 --- a/cross/gcc-aarch64/0006-Enable-Wformat-and-Wformat-security-by-default.patch +++ b/cross/gcc-aarch64/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -1,15 +1,17 @@ -From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001 +From 35c02ea8267e193b92f30495c94ee1e8e5c2be8e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH] 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 75b6531860e..78830ce4b42 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -774,7 +774,7 @@ Warn about function calls with format strings that write past the end +@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end of the destination region. Wformat-security @@ -18,7 +20,7 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -799,7 +799,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -27,3 +29,6 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about printf/scanf/strftime/strfmon format string anomalies. Wframe-address +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch index 140685d7b..eda9ab096 100644 --- a/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch @@ -1,16 +1,18 @@ -From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/35] Enable -Wtrampolines by default. +From 0b82663fd2f054e07e116c4dcc5019f7e969cd3e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:44:20 -0700 +Subject: [PATCH] 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 bea1adc0940..e65a575d9f8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -811,7 +811,7 @@ Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers. +@@ -829,7 +829,7 @@ Common Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wa + Warn if a comparison always evaluates to true or false. Wtrampolines -Common Var(warn_trampolines) Warning @@ -18,3 +20,6 @@ Subject: [PATCH 07/35] Enable -Wtrampolines by default. Warn whenever a trampoline is generated. Wtrivial-auto-var-init +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/cross/gcc-aarch64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch deleted file mode 100644 index e85284ff0..000000000 --- a/cross/gcc-aarch64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and - -ffreestanding Change the buffer size. - ---- - gcc/gcc.cc | 8 +++++++- - gcc/params.opt | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1000,6 +1000,12 @@ proper position among the other output files. */ - #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" - #endif - -+#ifdef ENABLE_DEFAULT_SSP -+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " -+#else -+#define NO_SSP_SPEC "" -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1305,7 +1311,7 @@ static const char *cc1_options = - %{-version:--version}\ - %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ -- %{fsyntax-only:-o %j} %{-param*}\ -+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ - %{coverage:-fprofile-arcs -ftest-coverage}\ - %{fprofile-arcs|fcondition-coverage|fprofile-generate*|coverage:\ - %{!fprofile-update=single:\ ---- a/gcc/params.opt -+++ b/gcc/params.opt -@@ -1013,7 +1013,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim - The maximum number of SSA_NAME assignments to follow in determining a value. - - -param=ssp-buffer-size= --Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization -+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization - The lower bound for a buffer to be considered for stack smashing protection. - - -param=stack-clash-protection-guard-size= diff --git a/cross/gcc-aarch64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch b/cross/gcc-aarch64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch new file mode 100644 index 000000000..8997916ca --- /dev/null +++ b/cross/gcc-aarch64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch @@ -0,0 +1,39 @@ +From 3acf32fc94fd447874b2f1447a19a65f0905bff5 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:49:03 -0700 +Subject: [PATCH] gcc: disable SSP on -ffreestanding, -nostdlib and + -nodefaultlibs + +--- + gcc/gcc.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9c7d15b04..7b0d3d2743b 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1009,6 +1009,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1314,7 +1320,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch b/cross/gcc-aarch64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch new file mode 100644 index 000000000..8b25ba72d --- /dev/null +++ b/cross/gcc-aarch64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch @@ -0,0 +1,25 @@ +From bb98973bdb5fe8bd040e238afe92845203929b59 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:50:42 -0700 +Subject: [PATCH] gcc: params: set default ssp-buffer-size to 4 + +--- + gcc/params.opt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/params.opt b/gcc/params.opt +index 64e453d29b7..bba3fd574f2 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -1064,7 +1064,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.50.1 + diff --git a/cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-aarch64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch similarity index 88% rename from cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch rename to cross/gcc-aarch64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index f4dd52f19..c903a5cce 100644 --- a/cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-aarch64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,8 +1,8 @@ -From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001 +From f89d8e95b809d02eceee416b463200c9abb2b33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during - gcc bootstrapping. +Subject: [PATCH] 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 12d34910830..61b13762b71 100644 +index 7f84a99533e..a4c6284f788 100644 --- a/libstdc++-v3/po/Makefile.am +++ b/libstdc++-v3/po/Makefile.am @@ -38,6 +38,7 @@ MSGFMT = msgfmt @@ -50,5 +50,5 @@ index 8e93445acd2..d6ff06e5ddb 100644 all-local: all-local-$(USE_NLS) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-aarch64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch similarity index 73% rename from cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch rename to cross/gcc-aarch64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch index f56d41a57..48b22a5dc 100644 --- a/cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-aarch64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,17 +1,17 @@ -From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001 +From b45303198567828a5240baf932a8c13255f35d20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/35] Don't declare asprintf if defined as a macro. +Subject: [PATCH] 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 1d5c779fcff..19e3cb1e31c 100644 +index d4e8791b14b..c074980ed80 100644 --- a/include/libiberty.h +++ b/include/libiberty.h -@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *, +@@ -678,8 +678,11 @@ extern void *bsearch_r (const void *, const void *, /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. */ @@ -24,5 +24,5 @@ index 1d5c779fcff..19e3cb1e31c 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-aarch64/0012-libiberty-copy-PIC-objects-during-build-process.patch similarity index 66% rename from cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch rename to cross/gcc-aarch64/0012-libiberty-copy-PIC-objects-during-build-process.patch index b12d4f94b..ff49be1c6 100644 --- a/cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-aarch64/0012-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,17 +1,17 @@ -From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001 +From 68e2c9356221ba30b27840b9449f742505584cf1 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/35] libiberty: copy PIC objects during build process +Subject: [PATCH] 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 72608f3e4a7..58356884728 100644 +index ce54d88278d..10c212a1ad3 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) +@@ -266,6 +266,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ @@ -20,5 +20,5 @@ index 72608f3e4a7..58356884728 100644 else true; fi -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0012-libgcc_s.patch b/cross/gcc-aarch64/0013-libgcc_s.patch similarity index 76% rename from cross/gcc-armhf/0012-libgcc_s.patch rename to cross/gcc-aarch64/0013-libgcc_s.patch index 8189f8491..99152585f 100644 --- a/cross/gcc-armhf/0012-libgcc_s.patch +++ b/cross/gcc-aarch64/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001 +From ca482f8c9cac9617855f908dd30d3d6144e850a0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 12/35] libgcc_s +Subject: [PATCH] libgcc_s --- gcc/config/i386/i386-expand.cc | 4 ++-- @@ -9,9 +9,11 @@ Subject: [PATCH 12/35] libgcc_s libgcc/config/i386/t-linux | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) +diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc +index cdfd94d3c73..a3a6c988833 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc -@@ -13089,10 +13089,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -13643,10 +13643,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -24,6 +26,8 @@ Subject: [PATCH 12/35] libgcc_s call_expr = build_call_expr (fndecl, 0); return expand_expr (call_expr, target, mode, EXPAND_NORMAL); } +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index 2484dc839bf..e980030ef23 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -63,7 +63,7 @@ __cpu_indicator_init (void) @@ -37,6 +41,8 @@ Subject: [PATCH 12/35] libgcc_s +int __cpu_indicator_init_local (void) + __attribute__ ((weak, alias ("__cpu_indicator_init"))); #endif +diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux +index 8506a635790..564296f788e 100644 --- a/libgcc/config/i386/t-linux +++ b/libgcc/config/i386/t-linux @@ -3,5 +3,5 @@ @@ -46,3 +52,6 @@ Subject: [PATCH 12/35] libgcc_s -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.50.1 + diff --git a/cross/gcc-armhf/0013-nopie.patch b/cross/gcc-aarch64/0014-nopie.patch similarity index 79% rename from cross/gcc-armhf/0013-nopie.patch rename to cross/gcc-aarch64/0014-nopie.patch index 4a9ea0770..7117a9434 100644 --- a/cross/gcc-armhf/0013-nopie.patch +++ b/cross/gcc-aarch64/0014-nopie.patch @@ -1,16 +1,18 @@ -From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001 +From 6dfb241ae9f879f4945941273dd73eb13f127b06 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 13/35] nopie +Subject: [PATCH] nopie --- gcc/configure | 25 +++++++++++++++++++++++++ gcc/configure.ac | 11 +++++++++++ 2 files changed, 36 insertions(+) +diff --git a/gcc/configure b/gcc/configure +index 0f4a5d52c30..343563c8948 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \ +@@ -34586,6 +34586,29 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 $as_echo "$gcc_cv_no_pie" >&6; } @@ -40,7 +42,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then +@@ -34603,6 +34626,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -49,9 +51,11 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b0e3615e5aa..b3948469d17 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -7802,6 +7802,15 @@ AC_CACHE_CHECK([for -no-pie option], [gcc_cv_no_pie=yes], [gcc_cv_no_pie=no]) LDFLAGS="$saved_LDFLAGS"]) @@ -67,7 +71,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then +@@ -7819,6 +7828,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -76,3 +80,6 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +-- +2.50.1 + diff --git a/cross/gcc-armhf/0014-ada-fix-shared-linking.patch b/cross/gcc-aarch64/0015-ada-fix-shared-linking.patch similarity index 90% rename from cross/gcc-armhf/0014-ada-fix-shared-linking.patch rename to cross/gcc-aarch64/0015-ada-fix-shared-linking.patch index ff6e42921..a893502b7 100644 --- a/cross/gcc-armhf/0014-ada-fix-shared-linking.patch +++ b/cross/gcc-aarch64/0015-ada-fix-shared-linking.patch @@ -1,14 +1,14 @@ -From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001 +From 8ac6aeca5d6192ee16b959bd8c1903a52d408a55 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 14/35] ada: fix shared linking +Subject: [PATCH] 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 f2126441208..22cfa9c641f 100644 +index 9e3385ca94f..2c0cca6e480 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; @@ -38,5 +38,5 @@ index f2126441208..22cfa9c641f 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-aarch64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch similarity index 70% rename from cross/gcc-aarch64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch rename to cross/gcc-aarch64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index ddea4a05b..a6adebb1f 100644 --- a/cross/gcc-aarch64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-aarch64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,12 +1,14 @@ -From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001 +From 7323d68ae46fc8e33c0746799d820a4e4c8c8b72 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + 1 file changed, 1 insertion(+) +diff --git a/Makefile.in b/Makefile.in +index b1ed67d3d4f..1e039c20550 100644 --- a/Makefile.in +++ b/Makefile.in @@ -179,6 +179,7 @@ BUILD_EXPORTS = \ @@ -17,3 +19,6 @@ Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing LDFLAGS="$(LDFLAGS_FOR_BUILD)" # This is the list of directories to built for the host system. +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0016-add-fortify-headers-paths.patch b/cross/gcc-aarch64/0017-add-fortify-headers-paths.patch similarity index 80% rename from cross/gcc-aarch64/0016-add-fortify-headers-paths.patch rename to cross/gcc-aarch64/0017-add-fortify-headers-paths.patch index b554e0251..b4ecd2fd5 100644 --- a/cross/gcc-aarch64/0016-add-fortify-headers-paths.patch +++ b/cross/gcc-aarch64/0017-add-fortify-headers-paths.patch @@ -1,14 +1,14 @@ -From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001 +From eaf89c8c91806905c6e1ec9519cbfb56296204b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 16/35] add fortify-headers paths +Subject: [PATCH] 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 e3aca79cccc..b3537b8fbeb 100644 +index d6280a4d4dd..ba69fb9fad7 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -21,5 +21,5 @@ index e3aca79cccc..b3537b8fbeb 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-aarch64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch similarity index 68% rename from cross/gcc-armv7/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch rename to cross/gcc-aarch64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index 4796a055d..84731bb57 100644 --- a/cross/gcc-armv7/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-aarch64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,9 +1,9 @@ -From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001 +From bdedcd9db7b8291637c5147dd82e8a9e3f5f9c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 21 Aug 2020 07:03:00 +0000 -Subject: [PATCH 17/35] 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] 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. @@ -12,9 +12,11 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We gcc/gcc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 7b0d3d2743b..e46e976a2e8 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1008,8 +1008,7 @@ proper position among the other output files. */ +@@ -1017,8 +1017,7 @@ proper position among the other output files. */ #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP @@ -24,3 +26,6 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.50.1 + diff --git a/cross/gcc-armv7/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-aarch64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch similarity index 84% rename from cross/gcc-armv7/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch rename to cross/gcc-aarch64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index b829e5b34..b703be7a7 100644 --- a/cross/gcc-armv7/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-aarch64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,16 +1,18 @@ -From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001 +From 586ce3614d4fc3fbeccf01659114a4643c1879c8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- gcc/gcc.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e46e976a2e8..607c8ca1d42 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -772,10 +772,10 @@ proper position among the other output files. */ +@@ -775,10 +775,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 "}" \ @@ -23,7 +25,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -811,10 +811,10 @@ proper position among the other output files. */ +@@ -814,10 +814,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 "}" \ @@ -36,7 +38,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -832,10 +832,10 @@ proper position among the other output files. */ +@@ -835,10 +835,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 "}" \ @@ -49,7 +51,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -851,10 +851,10 @@ proper position among the other output files. */ +@@ -854,10 +854,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 "}" \ @@ -62,3 +64,6 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-armv7/0019-aarch64-disable-multilib-support.patch b/cross/gcc-aarch64/0020-aarch64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-armv7/0019-aarch64-disable-multilib-support.patch rename to cross/gcc-aarch64/0020-aarch64-disable-multilib-support.patch index 5a8148feb..f2ad4bd64 100644 --- a/cross/gcc-armv7/0019-aarch64-disable-multilib-support.patch +++ b/cross/gcc-aarch64/0020-aarch64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001 +From 0ca7f92018d0bc04a72655f3b130c9aaeea1b771 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:12:55 +0000 -Subject: [PATCH 19/35] aarch64: disable multilib support +Subject: [PATCH] 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 57bf4100fcd..172894b57ef 100644 +index 70e36b3299e..e00c3becd3f 100644 --- a/gcc/config/aarch64/t-aarch64-linux +++ b/gcc/config/aarch64/t-aarch64-linux @@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm @@ -22,5 +22,5 @@ index 57bf4100fcd..172894b57ef 100644 MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0020-s390x-disable-multilib-support.patch b/cross/gcc-aarch64/0021-s390x-disable-multilib-support.patch similarity index 85% rename from cross/gcc-armhf/0020-s390x-disable-multilib-support.patch rename to cross/gcc-aarch64/0021-s390x-disable-multilib-support.patch index ef2f449a4..7b71aa3bc 100644 --- a/cross/gcc-armhf/0020-s390x-disable-multilib-support.patch +++ b/cross/gcc-aarch64/0021-s390x-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001 +From b48898c8fbd7828b81f407c74c25cf8e07fb73a4 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:13:59 +0000 -Subject: [PATCH 20/35] s390x: disable multilib support +Subject: [PATCH] s390x: disable multilib support multilib is not supported on Alpine GCC at present --- @@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0021-ppc64-le-disable-multilib-support.patch b/cross/gcc-aarch64/0022-ppc64-le-disable-multilib-support.patch similarity index 95% rename from cross/gcc-armhf/0021-ppc64-le-disable-multilib-support.patch rename to cross/gcc-aarch64/0022-ppc64-le-disable-multilib-support.patch index dbdc78828..5281a006c 100644 --- a/cross/gcc-armhf/0021-ppc64-le-disable-multilib-support.patch +++ b/cross/gcc-aarch64/0022-ppc64-le-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001 +From 158d93ce86f3d311ce489d0740326027068ca721 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:33 +0000 -Subject: [PATCH 21/35] ppc64[le]: disable multilib support +Subject: [PATCH] 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 01a94242308..b3a76379c03 100644 +index f56b47c268e..c5f757a6284 100644 --- a/gcc/config/rs6000/t-linux64 +++ b/gcc/config/rs6000/t-linux64 @@ -28,8 +28,8 @@ @@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644 +MULTILIB_OSDIRNAMES += m32=../lib32 MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0022-x86_64-disable-multilib-support.patch b/cross/gcc-aarch64/0023-x86_64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-armv7/0022-x86_64-disable-multilib-support.patch rename to cross/gcc-aarch64/0023-x86_64-disable-multilib-support.patch index 2b2f3e7f3..1e74e9462 100644 --- a/cross/gcc-armv7/0022-x86_64-disable-multilib-support.patch +++ b/cross/gcc-aarch64/0023-x86_64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001 +From 6957fc21caca80f5e01db15df6dc8de46c85167b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:54 +0000 -Subject: [PATCH 22/35] x86_64: disable multilib support +Subject: [PATCH] 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 138956b0962..bc03dab874f 100644 +index 64a4a20e64f..9a8eb8dd8d1 100644 --- a/gcc/config/i386/t-linux64 +++ b/gcc/config/i386/t-linux64 @@ -33,6 +33,6 @@ @@ -22,5 +22,5 @@ index 138956b0962..bc03dab874f 100644 +MULTILIB_OSDIRNAMES+= m32=../lib32 MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0023-riscv-disable-multilib-support.patch b/cross/gcc-aarch64/0024-riscv-disable-multilib-support.patch similarity index 90% rename from cross/gcc-armv7/0023-riscv-disable-multilib-support.patch rename to cross/gcc-aarch64/0024-riscv-disable-multilib-support.patch index eb9ba90fc..cc136a04f 100644 --- a/cross/gcc-armv7/0023-riscv-disable-multilib-support.patch +++ b/cross/gcc-aarch64/0024-riscv-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001 +From fdcbe7ee4ce81cdf247966385c8d521ac3f5a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 3 Jan 2022 07:14:48 +0100 -Subject: [PATCH 23/35] riscv: disable multilib support +Subject: [PATCH] riscv: disable multilib support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -42,6 +42,8 @@ library. gcc/config/riscv/t-linux | 7 +++++-- 2 files changed, 5 insertions(+), 10 deletions(-) +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 282c77b6a7b..07adae3d59c 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see @@ -56,6 +58,8 @@ library. - "/usr/lib/ " - -#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi +diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux +index a6f64f88d25..f88776ec520 100644 --- a/gcc/config/riscv/t-linux +++ b/gcc/config/riscv/t-linux @@ -1,5 +1,8 @@ @@ -69,3 +73,6 @@ library. +MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0025-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-aarch64/0025-ada-libgnarl-compatibility-for-musl.patch deleted file mode 100644 index b7c1c5f2f..000000000 --- a/cross/gcc-aarch64/0025-ada-libgnarl-compatibility-for-musl.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 25/35] ada: libgnarl compatibility for musl - ---- - gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ - gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- - 2 files changed, 3 insertions(+), 61 deletions(-) - -diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads -index 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 - PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; - -- function pthread_rwlockattr_setkind_np -- (attr : access pthread_rwlockattr_t; -- pref : int) return int; -- pragma Import -- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); -- - function pthread_rwlock_init - (mutex : access pthread_rwlock_t; - attr : access pthread_rwlockattr_t) return int; -@@ -470,11 +464,6 @@ package System.OS_Interface is - protocol : int) return int; - pragma Import (C, pthread_mutexattr_setprotocol); - -- function pthread_mutexattr_setprioceiling -- (attr : access pthread_mutexattr_t; -- prioceiling : int) return int; -- pragma Import (C, pthread_mutexattr_setprioceiling); -- - type struct_sched_param is record - 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 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 - pragma Import - (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); - -- function GNAT_has_cap_sys_nice return C.int; -- pragma Import -- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); - -- We do not have pragma Linker_Options ("-lcap"); here, because this - -- library is not present on many Linux systems. 'libcap' is the Linux - -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is - -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on - -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. - -- function Get_Ceiling_Support return Boolean; -- -- Get the value of the Ceiling_Support constant (see below). -- -- Note well: If this function or related code is modified, it should be -- -- tested by hand, because automated testing doesn't exercise it. -- -- ------------------------- -- -- Get_Ceiling_Support -- -- ------------------------- -- -- function Get_Ceiling_Support return Boolean is -- Ceiling_Support : Boolean := False; -- begin -- if Locking_Policy /= 'C' then -- return False; -- end if; -- -- declare -- function geteuid return Integer; -- pragma Import (C, geteuid, "geteuid"); -- Superuser : constant Boolean := geteuid = 0; -- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; -- pragma Assert (Has_Cap in 0 | 1); -- begin -- Ceiling_Support := Superuser or else Has_Cap = 1; -- end; -- -- return Ceiling_Support; -- end Get_Ceiling_Support; -- -- pragma Warnings (Off, "non-preelaborable call not allowed*"); -- Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-preelaborable call not allowed*"); - -- True if the locking policy is Ceiling_Locking, and the current process - -- has permission to use this policy. The process has permission if it is - -- running as 'root', or if the capability was set by the setcap command, -@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is - -- Init_Mutex -- - ---------------- - -+ pragma Warnings (Off, "formal parameter * is not referenced"); - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is -+ pragma Warnings (On, "formal parameter * is not referenced"); - Mutex_Attr : aliased pthread_mutexattr_t; - Result, Result_2 : C.int; - -@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is - return Result; - end if; - -- if Ceiling_Support then -- Result := pthread_mutexattr_setprotocol -- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); -- pragma Assert (Result = 0); -- -- Result := pthread_mutexattr_setprioceiling -- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); -- pragma Assert (Result = 0); -- -- elsif Locking_Policy = 'I' then -+ if Locking_Policy = 'I' then - Result := pthread_mutexattr_setprotocol - (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); - pragma Assert (Result = 0); -@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is - Result := pthread_rwlockattr_init (RWlock_Attr'Access); - pragma Assert (Result = 0); - -- Result := pthread_rwlockattr_setkind_np -- (RWlock_Attr'Access, -- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); -- pragma Assert (Result = 0); -- - Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); - - pragma Assert (Result in 0 | ENOMEM); --- -2.41.0 - diff --git a/cross/gcc-aarch64/0024-always-build-libgcc_eh.a.patch b/cross/gcc-aarch64/0025-always-build-libgcc_eh.a.patch similarity index 78% rename from cross/gcc-aarch64/0024-always-build-libgcc_eh.a.patch rename to cross/gcc-aarch64/0025-always-build-libgcc_eh.a.patch index 5d508ea08..5b21d4dd1 100644 --- a/cross/gcc-aarch64/0024-always-build-libgcc_eh.a.patch +++ b/cross/gcc-aarch64/0025-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001 +From 6f63901256443978a2c3746e72bd5762166a7790 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 24/35] always build libgcc_eh.a +Subject: [PATCH] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -9,9 +9,11 @@ highly inspired by: libgcc/Makefile.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index 0719fd0615d..80bb8f1622f 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -967,8 +967,9 @@ ifneq ($(LIBUNWIND),) +@@ -971,8 +971,9 @@ ifneq ($(LIBUNWIND),) all: libunwind.a endif @@ -22,7 +24,7 @@ highly inspired by: ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1173,10 +1174,6 @@ install-libunwind: +@@ -1177,10 +1178,6 @@ install-libunwind: install-shared: $(mkinstalldirs) $(DESTDIR)$(inst_libdir) @@ -33,7 +35,7 @@ highly inspired by: $(subst @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_base_name@,libgcc_s,$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -1193,6 +1190,10 @@ ifeq ($(enable_gcov),yes) +@@ -1197,6 +1194,10 @@ ifeq ($(enable_gcov),yes) $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a endif @@ -44,3 +46,6 @@ highly inspired by: parts="$(INSTALL_PARTS)"; \ for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch b/cross/gcc-aarch64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch new file mode 100644 index 000000000..e8fb24481 --- /dev/null +++ b/cross/gcc-aarch64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch @@ -0,0 +1,59 @@ +From a365def37f5de93ad85588d8e2c02c0df28e88d6 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:09:02 -0700 +Subject: [PATCH] ada: libgnarl: remove use of glibc-specific + pthread_rwlockattr_setkind_np + +musl's thread library does not implement it + +Signed-off-by: Ariadne Conill +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 10 ---------- + gcc/ada/libgnarl/s-taprop__linux.adb | 7 ------- + 2 files changed, 17 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 7aeb15da523..5551b701e5a 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -402,16 +402,6 @@ package System.OS_Interface is + (attr : access pthread_rwlockattr_t) return int; + pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy"); + +- PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0; +- PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; +- +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb +index 8f4c835baa7..6df36c7d8f4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -409,16 +409,9 @@ package body System.Task_Primitives.Operations is + Result : C.int; + + begin +- -- Set the rwlock to prefer writer to avoid writers starvation +- + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0026-ada-musl-support-fixes.patch b/cross/gcc-aarch64/0026-ada-musl-support-fixes.patch deleted file mode 100644 index 0be683fa6..000000000 --- a/cross/gcc-aarch64/0026-ada-musl-support-fixes.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 26/35] ada: musl support fixes - ---- - gcc/ada/Makefile.rtl | 16 ++++++++-------- - gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- - gcc/ada/adaint.h | 10 ++++------ - gcc/ada/terminals.c | 8 ++++---- - 4 files changed, 35 insertions(+), 33 deletions(-) - ---- a/gcc/ada/Makefile.rtl -+++ b/gcc/ada/Makefile.rtl -@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) - s-intman.adb - #include - #endif -+ -+#if defined (linux) || defined(__linux__) -+#define _GNU_SOURCE 1 -+#include -+#endif - - #ifdef __PikeOS__ - #define __BSD_VISIBLE 1 -@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void) - #endif - - #if defined (__linux__) --#include - - /* glibc versions earlier than 2.7 do not define the routines to handle - dynamically allocated CPU sets. For these targets, we use the static -@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void) - - /* Dynamic cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count) - { - return CPU_ALLOC (count); -@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { -- CPU_FREE (set); -+ CPU_FREE ((cpu_set_t *) set); - } - - void --__gnat_cpu_zero (size_t count, cpu_set_t *set) -+__gnat_cpu_zero (size_t count, void *set) - { -- CPU_ZERO_S (count, set); -+ CPU_ZERO_S (count, (cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET_S (cpu - 1, count, set); -+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); - } - - #else /* !CPU_ALLOC */ - - /* Static cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) - { -- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); -+ return xmalloc (sizeof (cpu_set_t)); - } - - size_t -@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { - free (set); - } - - void --__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) - { -- CPU_ZERO (set); -+ CPU_ZERO ((cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET (cpu - 1, set); -+ CPU_SET (cpu - 1, (cpu_set_t *) set); - } - #endif /* !CPU_ALLOC */ - #endif /* __linux__ */ ---- a/gcc/ada/adaint.h -+++ b/gcc/ada/adaint.h -@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void); - - /* Routines for interface to required CPU set primitives */ - --#include -- --extern cpu_set_t *__gnat_cpu_alloc (size_t); -+extern void * __gnat_cpu_alloc (size_t); - extern size_t __gnat_cpu_alloc_size (size_t); --extern void __gnat_cpu_free (cpu_set_t *); --extern void __gnat_cpu_zero (size_t, cpu_set_t *); --extern void __gnat_cpu_set (int, size_t, cpu_set_t *); -+extern void __gnat_cpu_free (void *); -+extern void __gnat_cpu_zero (size_t, void *); -+extern void __gnat_cpu_set (int, size_t, void *); - #endif - - #if defined (_WIN32) ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1134,7 +1134,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) -- 2- getpt (USE_GETPT) -+ 2- posix_openpt (USE_POSIX_OPENPT) - 3- openpty (USE_OPENPTY) - - When using the cloning device method, the macro USE_CLONE_DEVICE should -@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, - #if defined (__APPLE__) || defined (BSD) - #define USE_OPENPTY - #elif defined (__linux__) --#define USE_GETPT -+#define USE_POSIX_OPENPT - #elif defined (__sun__) - #define USE_CLONE_DEVICE "/dev/ptmx" - #elif defined (_AIX) -@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { - int master_fd = -1; - char *slave_name = NULL; - --#ifdef USE_GETPT -- master_fd = getpt (); -+#if defined(USE_POSIX_OPENPT) -+ master_fd = posix_openpt(O_RDWR | O_NOCTTY); - #elif defined (USE_OPENPTY) - status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); - #elif defined (USE_CLONE_DEVICE) diff --git a/cross/gcc-aarch64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch b/cross/gcc-aarch64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch new file mode 100644 index 000000000..c138a6034 --- /dev/null +++ b/cross/gcc-aarch64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch @@ -0,0 +1,50 @@ +From e1572457f94a26da9a588a36afa3eb0e74122c34 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:13:19 -0700 +Subject: [PATCH] ada: libgnarl: use posix_openpt instead of glibc-specific + getpt to open a pty + +musl only implements posix_openpt(3), not the older glibc-specific getpt() +and glibc implements both for ages. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/terminals.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index 89f887556c0..93557fe2631 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1134,7 +1134,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) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + #if defined (__APPLE__) || defined (BSD) + #define USE_OPENPTY + #elif defined (__linux__) +-#define USE_GETPT ++#define USE_POSIX_OPENPT + #elif defined (__sun__) + #define USE_CLONE_DEVICE "/dev/ptmx" + #elif defined (_AIX) +@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch b/cross/gcc-aarch64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch new file mode 100644 index 000000000..0bf61bd9f --- /dev/null +++ b/cross/gcc-aarch64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch @@ -0,0 +1,54 @@ +From 4f26d4bfedb7f942b69ca4743f053c3a690a0b4a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:18:49 -0700 +Subject: [PATCH] ada: libgnarl: adaint: fix sched.h inclusion for musl + +Signed-off-by: Ariadne Conill +--- + gcc/ada/adaint.c | 6 +++++- + gcc/ada/adaint.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 1fcfae165a7..67318e647ed 100644 +--- a/gcc/ada/adaint.c ++++ b/gcc/ada/adaint.c +@@ -95,6 +95,11 @@ + #include + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 + #endif +@@ -3476,7 +3481,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 3df12b5f956..26a489f2b78 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -40,6 +40,11 @@ extern "C" { + #include "mingw32.h" + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #include + + /* Constants used for the form parameter encoding values */ +-- +2.50.1 + diff --git a/cross/gcc-armhf/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-aarch64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch similarity index 86% rename from cross/gcc-armhf/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch rename to cross/gcc-aarch64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch index 0b92854c4..32c8c8724 100644 --- a/cross/gcc-armhf/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +++ b/cross/gcc-aarch64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch @@ -1,14 +1,14 @@ -From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001 +From 6592e702844d31bcef17c340bfc13e0e1be9f132 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 9 Dec 2020 07:42:06 +0000 -Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in +Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in LINK_GCC_C_SEQUENCE_SPEC [PR81358] This fixes issues with RISC-V. --- Makefile.in | 1 + - gcc/config/gnu-user.h | 12 +++++++++++- gcc/config.in | 6 ++++++ + gcc/config/gnu-user.h | 12 +++++++++++- gcc/configure | 31 ++++++++++++++++++++++++++++++- gcc/configure.ac | 21 +++++++++++++++++++++ gcc/doc/install.texi | 8 ++++++++ @@ -17,9 +17,11 @@ This fixes issues with RISC-V. gcc/gcc.cc | 12 +++++++++++- 9 files changed, 102 insertions(+), 5 deletions(-) +diff --git a/Makefile.in b/Makefile.in +index 1e039c20550..20f535a306a 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -237,6 +237,7 @@ HOST_EXPORTS = \ +@@ -238,6 +238,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; \ @@ -27,6 +29,25 @@ This fixes issues with RISC-V. HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ +diff --git a/gcc/config.in b/gcc/config.in +index 8a531ed591c..40045ff35a5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -131,6 +131,12 @@ + #endif + + ++/* Define if libatomic should always be linked. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_AUTOLINK_LIBATOMIC ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 3c17ac6eade..0426efdb8c3 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 @@ -49,24 +70,11 @@ This fixes issues with RISC-V. %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" #undef LINK_GCC_C_SEQUENCE_SPEC ---- a/gcc/config.in -+++ b/gcc/config.in -@@ -131,6 +131,12 @@ - #endif - - -+/* Define if libatomic should always be linked. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_AUTOLINK_LIBATOMIC -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET +diff --git a/gcc/configure b/gcc/configure +index 343563c8948..54300a2a867 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1002,6 +1002,7 @@ with_changes_root_url +@@ -1003,6 +1003,7 @@ with_changes_root_url enable_languages with_multilib_list with_multilib_generator @@ -74,7 +82,7 @@ This fixes issues with RISC-V. with_zstd with_zstd_include with_zstd_lib -@@ -1739,6 +1740,9 @@ Optional Features: +@@ -1742,6 +1743,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 @@ -84,7 +92,7 @@ This fixes issues with RISC-V. --disable-rpath do not hardcode runtime library paths --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling -@@ -8380,7 +8384,6 @@ else +@@ -8400,7 +8404,6 @@ else fi @@ -92,7 +100,7 @@ This fixes issues with RISC-V. # Check whether --with-multilib-generator was given. if test "${with_multilib_generator+set}" = set; then : withval=$with_multilib_generator; : -@@ -8388,6 +8391,32 @@ else +@@ -8408,6 +8411,32 @@ else with_multilib_generator=default fi @@ -125,9 +133,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b3948469d17..81c070830e2 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -1215,6 +1215,27 @@ AC_ARG_WITH(multilib-generator, +@@ -1227,6 +1227,27 @@ AC_ARG_WITH(multilib-generator, :, with_multilib_generator=default) @@ -155,9 +165,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs # ------------------------- +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 3e9e09b4ae3..6e7b756be61 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi -@@ -2525,6 +2525,14 @@ files, but these changed header paths may conflict with some compilation +@@ -2617,6 +2617,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}. @@ -172,6 +184,8 @@ This fixes issues with RISC-V. @item --with-glibc-version=@var{major}.@var{minor} 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 a96700c0d38..16deedca64d 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -189,6 +203,8 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in +index eccc4d88493..4ca4c610571 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -206,9 +222,11 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 607c8ca1d42..e9f78f0f4c1 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -991,13 +991,23 @@ proper position among the other output files. */ +@@ -1000,13 +1000,23 @@ proper position among the other output files. */ # define ASM_DEBUG_OPTION_SPEC "" #endif @@ -233,3 +251,6 @@ This fixes issues with RISC-V. #endif #ifdef ENABLE_DEFAULT_SSP +-- +2.50.1 + diff --git a/cross/gcc-armhf/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-aarch64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch similarity index 90% rename from cross/gcc-armhf/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch rename to cross/gcc-aarch64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch index f92fc7bf4..5aed9caf5 100644 --- a/cross/gcc-armhf/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch +++ b/cross/gcc-aarch64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -1,8 +1,8 @@ -From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 +From 952070c1616f231a810af2da50264713d7587b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 29 Aug 2021 12:23:34 +0200 -Subject: [PATCH 28/35] configure: fix detection of atomic builtins in - libatomic configure script +Subject: [PATCH] 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 a92ae9e8309..90b579ca4d8 100644 +index 6db039d6e8b..2751b5c1387 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -30,6 +30,26 @@ @@ -53,5 +53,5 @@ index a92ae9e8309..90b579ca4d8 100644 alpha*) # fenv.c needs this option to generate inexact exceptions. -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-aarch64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch similarity index 78% rename from cross/gcc-aarch64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch rename to cross/gcc-aarch64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch index 4418cd5b5..2b7259a4d 100644 --- a/cross/gcc-aarch64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +++ b/cross/gcc-aarch64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch @@ -1,15 +1,15 @@ -From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001 +From 896b002a2afacb4d75d573aca4ae53b499df19cd Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 30 Jun 2022 16:44:51 +0000 -Subject: [PATCH 29/35] libstdc++: do not throw exceptions for non-C locales on - musl targets +Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl + targets --- libstdc++-v3/config/locale/generic/c_locale.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc -index 8849d78fdfa..aff467f98fe 100644 +index bfd02b5c2c6..16f9e84d66f 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 @@ -23,5 +23,5 @@ index 8849d78fdfa..aff467f98fe 100644 void -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-aarch64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch similarity index 66% rename from cross/gcc-aarch64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch rename to cross/gcc-aarch64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch index fde874c35..452ced2ee 100644 --- a/cross/gcc-aarch64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch +++ b/cross/gcc-aarch64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch @@ -1,17 +1,18 @@ -From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001 +From 22d69ae3e2768d301ef5a1f1b362c25cf8bf27b9 Mon Sep 17 00:00:00 2001 From: Mathias LANG Date: Mon, 17 Jan 2022 03:49:21 +0000 -Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against - libucontext +Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext ref: alpine/aports#13422 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/Makefile.in b/Makefile.in +index 20f535a306a..c087bfe7cd4 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -54362,7 +54362,7 @@ configure-target-libphobos: +@@ -54382,7 +54382,7 @@ configure-target-libphobos: esac; \ module_srcdir=libphobos; \ rm -f no-such-file || : ; \ @@ -20,3 +21,6 @@ ref: alpine/aports#13422 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.50.1 + diff --git a/cross/gcc-armv7/0031-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-aarch64/0033-druntime-link-against-libucontext-on-all-platforms.patch similarity index 81% rename from cross/gcc-armv7/0031-druntime-link-against-libucontext-on-all-platforms.patch rename to cross/gcc-aarch64/0033-druntime-link-against-libucontext-on-all-platforms.patch index 72f9370ee..920cf677e 100644 --- a/cross/gcc-armv7/0031-druntime-link-against-libucontext-on-all-platforms.patch +++ b/cross/gcc-aarch64/0033-druntime-link-against-libucontext-on-all-platforms.patch @@ -1,7 +1,7 @@ -From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001 +From dc66835022cf68085400f2eed30614c5afdc28a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sat, 16 Jul 2022 09:21:11 +0200 -Subject: [PATCH 31/35] druntime: link against libucontext on all platforms +Subject: [PATCH] druntime: link against libucontext on all platforms On musl-based Linux distributions, swapcontext etc. are not provided by musl but instead by libucontext. Hence, we _always_ need to link against @@ -11,9 +11,11 @@ an external library for these functions. libphobos/m4/druntime/libraries.m4 | 8 -------- 2 files changed, 16 deletions(-) +diff --git a/libphobos/configure b/libphobos/configure +index 4f5be7d4ff4..0a48032edb4 100755 --- a/libphobos/configure +++ b/libphobos/configure -@@ -15375,14 +15375,6 @@ fi +@@ -15420,14 +15420,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 @@ -28,6 +30,8 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 $as_echo_n "checking for library containing swapcontext... " >&6; } +diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 +index 8dd9c7da107..b61bf528a14 100644 --- a/libphobos/m4/druntime/libraries.m4 +++ b/libphobos/m4/druntime/libraries.m4 @@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], @@ -45,3 +49,6 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then AC_SEARCH_LIBS([swapcontext], [c ucontext], [], AC_MSG_ERROR([swapcontext required but not found])) +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0033-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-aarch64/0033-libphobos-do-not-use-LFS64-symbols.patch deleted file mode 100644 index 138bd64b7..000000000 --- a/cross/gcc-aarch64/0033-libphobos-do-not-use-LFS64-symbols.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 29 May 2023 15:33:11 +0000 -Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols - -musl does not have these since 1.2.4, we can't use the compat interfaces. ---- - libphobos/libdruntime/core/sys/posix/config.d | 2 +- - libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- - 2 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d -index ae6752f220e..6b80d1ff0e6 100644 ---- a/libphobos/libdruntime/core/sys/posix/config.d -+++ b/libphobos/libdruntime/core/sys/posix/config.d -@@ -88,7 +88,7 @@ else version (CRuntime_Musl) - enum __REDIRECT = false; - - // Those three are irrelevant for Musl as it always uses 64 bits off_t -- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64; -+ enum __USE_FILE_OFFSET64 = false; - enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT; - enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT; - -diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d -index 0d3d517d69a..323aa0af72d 100644 ---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d -+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d -@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) - } - else version (CRuntime_Musl) - { -- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); -- static if (__USE_FILE_OFFSET64) -- alias mmap = mmap64; -- else -- void* mmap(void*, size_t, int, int, int, off_t); -+ void* mmap(void*, size_t, int, int, int, off_t); - int munmap(void*, size_t); - } - else version (CRuntime_UClibc) --- -2.41.0 - diff --git a/cross/gcc-armv7/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-aarch64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch similarity index 64% rename from cross/gcc-armv7/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch rename to cross/gcc-aarch64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch index b53e5847d..38354fa65 100644 --- a/cross/gcc-armv7/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +++ b/cross/gcc-aarch64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch @@ -1,15 +1,17 @@ -From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001 +From ab88348da140c68e5e1142041dbe1c7b7d9c9a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 19 Jul 2022 14:54:07 +0200 -Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc +Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc --- gcc/ada/libgnat/s-parame.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 98284a4d13e..0d14f116a10 100644 --- a/gcc/ada/libgnat/s-parame.ads +++ b/gcc/ada/libgnat/s-parame.ads -@@ -100,7 +100,7 @@ package System.Parameters is +@@ -101,7 +101,7 @@ package System.Parameters is -- Characteristics of time_t type -- ------------------------------------ @@ -18,3 +20,6 @@ Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc -- Number of bits in type time_t ---------------------------------------------- +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0035-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-aarch64/0035-libphobos-do-not-use-LFS64-symbols.patch new file mode 100644 index 000000000..692f764f6 --- /dev/null +++ b/cross/gcc-aarch64/0035-libphobos-do-not-use-LFS64-symbols.patch @@ -0,0 +1,30 @@ +From f865fb0a27252bd3a01fc4596f101d389929311c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 29 May 2023 15:33:11 +0000 +Subject: [PATCH] libphobos: do not use LFS64 symbols + +musl does not have these since 1.2.4, we can't use the compat interfaces. +--- + libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d +index b1eb9fa8107..3aee0d96319 100644 +--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d ++++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d +@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) + } + else version (CRuntime_Musl) + { +- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); +- static if (__USE_FILE_OFFSET64) +- alias mmap = mmap64; +- else +- void* mmap(void*, size_t, int, int, int, off_t); ++ void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); + } + else version (CRuntime_UClibc) +-- +2.50.1 + diff --git a/cross/gcc-armv7/0034-libgo-fix-lfs64-use.patch b/cross/gcc-aarch64/0036-libgo-fix-lfs64-use.patch similarity index 98% rename from cross/gcc-armv7/0034-libgo-fix-lfs64-use.patch rename to cross/gcc-aarch64/0036-libgo-fix-lfs64-use.patch index cf47858d6..355edd642 100644 --- a/cross/gcc-armv7/0034-libgo-fix-lfs64-use.patch +++ b/cross/gcc-aarch64/0036-libgo-fix-lfs64-use.patch @@ -1,7 +1,7 @@ -From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001 +From cf6ba089ba26cd970962e874a3e35f020c3e921c Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 10 Jul 2023 23:23:29 +0000 -Subject: [PATCH 34/35] libgo: fix lfs64 use +Subject: [PATCH] libgo: fix lfs64 use --- .../go/internal/syscall/unix/at_largefile.go | 2 +- @@ -191,5 +191,5 @@ index 180f5c31d74..1d717d55c0e 100644 EREF(PRIO_USER); EREF(RUSAGE_SELF); -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0036-libphobos-add-riscv64-and-loongarch64-support.patch b/cross/gcc-aarch64/0036-libphobos-add-riscv64-and-loongarch64-support.patch deleted file mode 100644 index ba8377b1d..000000000 --- a/cross/gcc-aarch64/0036-libphobos-add-riscv64-and-loongarch64-support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Celeste -Date: Mon, 2 Sep 2024 02:54:17 +0000 -Subject: [PATCH] libphobos: add riscv64 and loongarch64 support - -Add musl support for these 2 architectures based on fenv.h and signal.h from: - -https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5 - -https://git.musl-libc.org/cgit/musl/tree/arch/loongarch64/bits?h=v1.2.5 ---- - libphobos/libdruntime/core/stdc/fenv.d | 13 +++++++++++++ - libphobos/libdruntime/core/sys/posix/signal.d | 10 ++++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d -index a7364c0a..5b327e4a 100644 ---- a/libphobos/libdruntime/core/stdc/fenv.d -+++ b/libphobos/libdruntime/core/stdc/fenv.d -@@ -436,20 +436,33 @@ else version (CRuntime_Musl) - ushort __cs_selector; - ushort __opcode; - uint __data_offset; - ushort __data_selector; - ushort __unused5; - version (X86_64) - uint __mxcsr; - } - alias ushort fexcept_t; - } -+ else version (RISCV64) -+ { -+ alias uint fenv_t; -+ alias uint fexcept_t; -+ } -+ else version (LoongArch64) -+ { -+ struct fenv_t -+ { -+ uint __cw; -+ } -+ alias uint fexcept_t; -+ } - else - { - static assert(false, "Architecture not supported."); - } - } - else version (CRuntime_Newlib) - { - version (AArch64) - { - alias fenv_t = ulong; -diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d -index a8b7f751..78d8b3cd 100644 ---- a/libphobos/libdruntime/core/sys/posix/signal.d -+++ b/libphobos/libdruntime/core/sys/posix/signal.d -@@ -2751,20 +2751,30 @@ else version (CRuntime_Musl) - else version (PPC_Any) - { - enum MINSIGSTKSZ = 4096; - enum SIGSTKSZ = 10240; - } - else version (X86_Any) - { - enum MINSIGSTKSZ = 2048; - enum SIGSTKSZ = 8192; - } -+ else version (RISCV64) -+ { -+ enum MINSIGSTKSZ = 2048; -+ enum SIGSTKSZ = 8192; -+ } -+ else version (LoongArch64) -+ { -+ enum MINSIGSTKSZ = 4096; -+ enum SIGSTKSZ = 16384; -+ } - else - static assert(0, "unimplemented"); - - //ucontext_t (defined in core.sys.posix.ucontext) - //mcontext_t (defined in core.sys.posix.ucontext) - - version (MIPS_Any) - { - struct stack_t - { diff --git a/cross/gcc-aarch64/0035-loongarch-disable-multilib-support.patch b/cross/gcc-aarch64/0037-loongarch-disable-multilib-support.patch similarity index 87% rename from cross/gcc-aarch64/0035-loongarch-disable-multilib-support.patch rename to cross/gcc-aarch64/0037-loongarch-disable-multilib-support.patch index acfc47c7f..da7e8b34d 100644 --- a/cross/gcc-aarch64/0035-loongarch-disable-multilib-support.patch +++ b/cross/gcc-aarch64/0037-loongarch-disable-multilib-support.patch @@ -1,15 +1,15 @@ -From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001 +From a809e7b909e16fcf3379571417d33574e9c1dbff Mon Sep 17 00:00:00 2001 From: Jingyun Hua Date: Mon, 7 Aug 2023 15:25:58 +0800 Subject: [PATCH] loongarch disable multilib support Signed-off-by: Jingyun Hua --- - gcc/config/loongarch/t-linux | 11 +++-------- + gcc/config/loongarch/t-linux | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux -index 23e1fb979..c2753abb8 100644 +index 45862048abf..73155acd832 100644 --- a/gcc/config/loongarch/t-linux +++ b/gcc/config/loongarch/t-linux @@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) @@ -28,5 +28,5 @@ index 23e1fb979..c2753abb8 100644 + MULTILIB_OSDIRNAMES += mabi.lp64f=../lib + MULTILIB_OSDIRNAMES += mabi.lp64s=../lib -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0037-static-pie.patch b/cross/gcc-aarch64/0038-static-PIE-ensure-static-reaches-the-linker.patch similarity index 72% rename from cross/gcc-aarch64/0037-static-pie.patch rename to cross/gcc-aarch64/0038-static-PIE-ensure-static-reaches-the-linker.patch index a31c20e7e..bd870a370 100644 --- a/cross/gcc-aarch64/0037-static-pie.patch +++ b/cross/gcc-aarch64/0038-static-PIE-ensure-static-reaches-the-linker.patch @@ -1,17 +1,26 @@ -Patch-Source: https://github.com/richfelker/musl-cross-make/blob/6f3701d08137496d5aac479e3a3977b5ae993c1f/patches/gcc-14.2.0/0004-static-pie.diff +From 72606254a2456763cb252b4d729a9505e77e449d Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Fri, 25 Jul 2025 02:41:46 -0700 +Subject: [PATCH] static PIE: ensure -static reaches the linker -gcc doesn't enable static-pie for all arches. As of this writing arm -32-bit is missing. musl supports static-pie on all arches so this -should be allowed on all arches. +on some targets, the logic for the compiler option -static seems not +to be processed when -pie is present. rather than playing +whack-a-mole, just ensure LD_PIE_SPEC specs always pass -static to ld +if either -static or -static-pie is present on the compiler driver +command line. -Without this patch binaries with (only) -static-pie are broken on some -arches. +this may produce redundant -static arguments but it doesn't matter. +--- + gcc/common.opt | 4 ++-- + gcc/config/gnu-user.h | 17 ++++++++--------- + gcc/gcc.cc | 6 +++--- + 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 +index e65a575d9f8..7ad38711f6e 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver +@@ -3968,11 +3968,11 @@ Driver no-pie Driver RejectNegative Negative(shared) @@ -26,7 +35,7 @@ index a75b44ee47e..7c564818b49 100644 static-pie Driver RejectNegative Negative(pie) diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 +index 0426efdb8c3..866c8bd77f2 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -70,12 +79,12 @@ index 5ebbf42a13d..bb907d8e89a 100644 +#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " #endif - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ + #if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) diff --git a/gcc/gcc.cc b/gcc/gcc.cc -index 3c81c5798d8..cd96eac5d12 100644 +index e9f78f0f4c1..767ff65f348 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ +@@ -1056,7 +1056,7 @@ proper position among the other output files. */ #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" #else @@ -84,12 +93,12 @@ index 3c81c5798d8..cd96eac5d12 100644 #define FPIE1_SPEC "fpie" #define NO_FPIE1_SPEC FPIE1_SPEC ":;" #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ +@@ -1080,12 +1080,12 @@ proper position among the other output files. */ #ifndef LINK_PIE_SPEC #ifdef HAVE_LD_PIE #ifndef LD_PIE_SPEC -#define LD_PIE_SPEC "-pie" -+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic %{static-pie:-static}}" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic -static}" #endif #else #define LD_PIE_SPEC "" @@ -99,3 +108,6 @@ index 3c81c5798d8..cd96eac5d12 100644 #endif #ifndef LINK_BUILDID_SPEC +-- +2.50.1 + diff --git a/cross/gcc-armhf/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-aarch64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch similarity index 97% rename from cross/gcc-armhf/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch rename to cross/gcc-aarch64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch index b55477e53..c713030bb 100644 --- a/cross/gcc-armhf/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +++ b/cross/gcc-aarch64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch @@ -1,4 +1,4 @@ -From 49926c2c657dd867f7329df6e250913fd1425475 Mon Sep 17 00:00:00 2001 +From d984c5c9ed973bb7072b48399e5d9bb1f35c3123 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 28 Mar 2025 17:25:56 -0700 Subject: [PATCH] except: Don't use the cached value of the gcc_except_table @@ -73,5 +73,5 @@ index 00000000000..50afa75a43f +// There should be 3 exception tables, +// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } -- -2.49.0 +2.50.1 diff --git a/cross/gcc-aarch64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch b/cross/gcc-aarch64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch new file mode 100644 index 000000000..a25266014 --- /dev/null +++ b/cross/gcc-aarch64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch @@ -0,0 +1,164 @@ +From 57eb290b3c8fc36da99213f5050b46cd93575234 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Sat, 26 Jul 2025 02:59:45 -0700 +Subject: [PATCH] ada: libgnat: use stub symbolic module name functions + +The "linux" implementation depends on glibc internals and accordingly +does not work on musl. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/Makefile.rtl | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index cb41e6887cd..152ba70db4d 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1642,7 +1642,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb +Date: Sat, 26 Jul 2025 03:02:38 -0700 +Subject: [PATCH] ada: libgnat: recognize linux-musleabi and linux-muslgnueabi + platforms for ARM + +--- + gcc/ada/Makefile.rtl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 152ba70db4d..89574cdfba7 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2500,7 +2500,7 @@ endif + + # ARM linux, GNU eabi + ifeq ($(SELECTED_PAIRS),PAIRS_NONE) +-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),) ++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),) + + SELECTED_PAIRS=arm-linux-gnueabi + +-- +2.50.1 + diff --git a/cross/gcc-aarch64/APKBUILD b/cross/gcc-aarch64/APKBUILD index 17bf2a626..6753df6b8 100644 --- a/cross/gcc-aarch64/APKBUILD +++ b/cross/gcc-aarch64/APKBUILD @@ -24,7 +24,7 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-aarch64 -pkgver=14.3.0 +pkgver=15.1.1_git20250719 # i.e. 13.2.1, must match gcc/BASE-VER _pkgbase="${pkgver%%_git*}" # date component from snapshots @@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-aarch64 -pkgrel=6 +pkgrel=2 pkgdesc="Stage2 cross-compiler for aarch64" url="https://gcc.gnu.org" arch="x86_64" @@ -183,7 +183,7 @@ if $_libgomp; then fi case "$CTARGET_ARCH" in -riscv64|loongarch64) +riscv64) LANG_ADA=false;; esac @@ -241,7 +241,7 @@ fi # PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches, # so that they can be properly tracked and easily rebased if needed. #source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz -source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz +source="https://gcc.gnu.org/pub/gcc/snapshots/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-specs-turn-on-Wl-z-now-by-default.patch @@ -249,37 +249,40 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch 0006-Enable-Wformat-and-Wformat-security-by-default.patch 0007-Enable-Wtrampolines-by-default.patch - 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch - 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch - 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch - 0011-libiberty-copy-PIC-objects-during-build-process.patch - 0012-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-libphobos-do-not-use-LFS64-symbols.patch - 0034-libgo-fix-lfs64-use.patch - 0035-loongarch-disable-multilib-support.patch - 0036-libphobos-add-riscv64-and-loongarch64-support.patch - 0037-static-pie.patch - 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch + 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch + 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0012-libiberty-copy-PIC-objects-during-build-process.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-ada-fix-shared-linking.patch + 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0017-add-fortify-headers-paths.patch + 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0020-aarch64-disable-multilib-support.patch + 0021-s390x-disable-multilib-support.patch + 0022-ppc64-le-disable-multilib-support.patch + 0023-x86_64-disable-multilib-support.patch + 0024-riscv-disable-multilib-support.patch + 0025-always-build-libgcc_eh.a.patch + 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch + 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch + 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch + 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch + 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch + 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch + 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch + 0033-druntime-link-against-libucontext-on-all-platforms.patch + 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch + 0035-libphobos-do-not-use-LFS64-symbols.patch + 0036-libgo-fix-lfs64-use.patch + 0037-loongarch-disable-multilib-support.patch + 0038-static-PIE-ensure-static-reaches-the-linker.patch + 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch + 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " # secfixes: @@ -287,8 +290,8 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz # - CVE-2023-4039 # we build out-of-tree -#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap -builddir="$srcdir"/gcc-$_pkgbase +builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap +#builddir="$srcdir"/gcc-$_pkgbase _gcclibdir="usr/lib/gcc/$CTARGET/$_pkgbase" _gcclibexec="usr/libexec/gcc/$CTARGET/$_pkgbase" @@ -752,43 +755,46 @@ gdb() { } sha512sums=" -cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93 gcc-14.3.0.tar.xz -1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch -6dd1eecbc050e30e5a0493969a0e80507d971f4ca87c06466f725fa50c9106e18aef86453fc8a80cd277438b6e79695a99cdaf2eaeb2f1add7e28f7cffd0cd2f 0002-gcc-poison-system-directories.patch -b6903b60b01187bfebc961e74d01ff5d8dc2852747663dff2b4a4f66df4b5aa412347fe92926cce1821fdd0c59d088404acbbced4b464aba9664d599a9e1bbce 0003-specs-turn-on-Wl-z-now-by-default.patch -d41a519ea5014e9ab49f017d3793e2a0a82429c2b7ded2776f2df7a2d0ac02aa294e7dbe74e027fe7c844c87525d483e0eda3846cf16340eb02e934389cfd838 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e34d7bb51c4c413b1a10bafcdfd5729fb5980b0288277ef44ed4779700d443d2fd22129b3b22d401def140851263e803160d2f3ed8825b0bf4f3fb8606db77bd 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -83665b6adb0b8080245b253abe3344ee5106ac2bc248aad9bef713b22b644a268d75c75fbab7554e0543836903a89bc4f0bec4b6d6d4e3d5ba355dddbc5ba190 0006-Enable-Wformat-and-Wformat-security-by-default.patch -ca5757a32f02bb24bc5b42bb03dca49fb9f9e6f34776343f1c5580efd2bcacf8c5b59f4b61652fa3ea1506eb14bcd390f5fda7b4cbfd32f7d1a750d14add4739 0007-Enable-Wtrampolines-by-default.patch -e476da4c2f29a941b7f4f1dfc9a37ba82b439badc47fc3fb72630ec5620f64849bdb66d339e0182674a0ee898a75564ffaf702986b770bfd793e7fbdcaa9f21b 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch -b40b6cbc3725ae88c506bc39a8ba10cfcdcc208fa26d667393bbb80e24346da2ccfac3ff914bb9fc4c374f022fa7f913e6873b9a66a96b79a1ac84959c9d5348 0012-libgcc_s.patch -6cc2c00b15d259289fa9831b60b58f8afdf09858410bd08ab3d839a45c6f3fb9e8e214dab851d105c61df7965f1c10255c84b5b6301630a390b27b8929a25e1e 0013-nopie.patch -0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch -7640e71cd957066e2e07ffcec1f8540cd6b1bdaf976c980693bf6f5d3afaf51ca7e41c62f92cb13c86c2dea9eb9cd799b2e3ea77d74926e82bf1e12bb7a4d64e 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch -8a8c9dc96f300f660f1a643c800352383f32db258dfcfa88a44159a38bb81a7298089a5dcb23906002c85cafc806caf6f3db0e1cb26fcac6192ae1e41d9ada3a 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -6c1cbfcf9e6f54b2173af39bbbfd97e7c18ae32a690fb4c6b1e35fa183992ea0f8046d479be57b6ac7d798bf2a6dade4f9ea3e3a839dc6fb8d47203de9c89e25 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch -a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch -f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch -44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch -0ef65a344975b641343767e289578ba5b0fd381c7177ebe4558cb67d8b41e33e3b825478fa46852f1f40ec9119ff908cf75ee36307266aea13f39460e080b0b6 0023-riscv-disable-multilib-support.patch -55438233a217dc1ee58990413b8782b9bd560a1532c1e6c860f377072ed1bdf75d5dc2458ed33194040ec5427c30df3fa68948dcd26de90e3803d3f7b784becd 0024-always-build-libgcc_eh.a.patch -8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch -02e8358b8855fb49bbb2b3ef293cff67441c5fdf1f2fee4dcec86ef1fd4f701e899ea9c7e072d888b0f1e674d7874d3085138f3deb9845d1f2e35d4a1fe3f5ab 0026-ada-musl-support-fixes.patch -8eff7679140f9e39f1a0ac2e4a6cc7e131efa3d5a669696dd28300eb5d75ef3be62f10c1b91d8f8c8ba2cba1ff9cf121228b6fcd3adafa28389ac63698e7d5a7 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch -720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch -2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch -458c9b121e00cec4d0dbe1d18c5e5332342eb0a3429129e5a9d9ace3247c31d85571ad9f47046c4ed3bc62e5d8a4297f48744a30424a19acbdd9aa484e3ee715 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch -099103f4b0b4612ff4bd2e8721cf1593415b636bff74d4feba304bb610ced6f4951cb3ab89088111e58029a2f9bf4a5dcc91e2b2afe4dd9813d2fa6b0999a5a2 0031-druntime-link-against-libucontext-on-all-platforms.patch -21ff4d55eec48ad4a9db0cd359e760cff548f7f6b1a67759a2e87fc7e16a262d82d2f980d309a3ce5e14097665beeb5516a5f2d98869a5d28345e685c6fe689d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch -c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch -c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch -65df1d489e8d07a811f39e27fd29e3b2b4164fbc2c5fdc16a5142886d94a96e3fb28ccf4f20dd297ba6540ef8ea1ac3eb65a4279494639bf2f0f8376a3896cc3 0035-loongarch-disable-multilib-support.patch -06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch -8249ce989c1a76bcb5bbb1123ef88d88f220b709fe6ac804f18c905a7b31c4e68ef6f5cc2236f446feed89fa773a3aed996a6aba7618e73a000d73cb0b0753f6 0037-static-pie.patch -90b6148d47f39caf1b70416abf2a09f4ce048491f784f56bd659dbf99e2c9f6a44b244827f23977494ab4e42640c49c1dc79f43a4d69c2b31c4b1e25d54d8142 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +a5e0082e492502385565479201bca3e9f5138a55d83540bff8b84a94d958c4d2afce474328656ee7d55fad910c04523c0068efe92382e68a327a65f6e641b88a gcc-15-20250719.tar.xz +fd5cebc5deb1d588583424acbc1b5a6d8d6f5b1bfa9f4bdbc082cfd406723f423d87011ee30e04ed18128a7ed8021cbfc9262becff5419125dc1afb6f407defa 0001-posix_memalign.patch +6634004cb9feea9ee0d063d6b6984d7db3b10c692b6139bb99169a4f2d74f0e10b5ca0ab31ce346ffef34b8eb9c3f536aa4d94bce1b27f8e0b8a9fc5cc4b7057 0002-gcc-poison-system-directories.patch +37e089791dbcbad73af866b662cda611dc0970d93e28251c7a9aa898db3b96446654e8b778d7866eb8550ba7f4a57cf22e8514d562bfed0c66613e65550d9c85 0003-specs-turn-on-Wl-z-now-by-default.patch +d4d5bfeb20a9fac968f37497d86d7eff4a9ac863e015dadbffae24c08236f5efde69b615d95191e2546672ce2d4b30d3627528c64a83fc64b715e8fa6fd4c372 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +b77cd1ee887fc52afee2fafd2d338f70a62c115017aa4fcb0ab9cf82b8a003794f75b7913cc153c767c351d2be8e1e7c113f893edee818217f20cad3cb6a2e66 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +af634de360e8b7aef285702815affb16da667719b786848ccdb9e4cca2a27826793f64c903a32a5d8ba1953965a5cc8999c58e2b6ce9ef36f74807e495cc9e42 0006-Enable-Wformat-and-Wformat-security-by-default.patch +21ad1cd4b7ef652ddaf6b9fb8071a87ec2fc694e8c420a79baf456347b8e1db5930a914c92a375943dda63d096c4823a2b8028d02a5b49c9bcdab5c170558004 0007-Enable-Wtrampolines-by-default.patch +dcd07ecf0daad8743a378abbcb921d4b17e528651a596454956563a3417fe9ea3b88dce7b15b9270f55ae2ea2a72efe8a7215236d0a21e2942c7c5ba0e8e2c39 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch +488bd530e209e3213f83d695fb2ac529c408e3dba9024457594cfb0d266acb079447bca184fbf136bacd1f1ec5ca3607dc4998b66630af9781ea7ee41c16236b 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch +7229a3fe655e8460148e0cd4c39d7362e713d1a6215530547f346371a5e3647245123637e8b075c58c5e7e35c823d96a0b3cdbedb6c07b5095507b4499bc053a 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +f7c1870bda4d418380f471b520b7cf20fde743f57415323c1a8898a815f8c7023adc3882e1d0453c5b6fcb65a27a9534fdeb297bf451453a95d90c0395e42c3b 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch +140c8165726404da0fc0ea01add2a7fa307377817968177334c520bdaabc23e8ec5d76f80337b89ff03edfd52dead7119433a03d2165e24780dc944633a9c2a3 0012-libiberty-copy-PIC-objects-during-build-process.patch +af848ef58b63a7592ad0f549be65fbe8dcd3c1e5ea9f30cfa65be02519ca9826d7612131c3b0042615b7537683d74eeb6849aba61810b0d8ed1c79f968188260 0013-libgcc_s.patch +c97b473c08b46090b48764af55b244ec70a13d26f2d881c57761abbc4a1c481da9766f33e59daee7188bc06c4631e53becbaf8801d0b35ca0b5fe84cb6a840f7 0014-nopie.patch +9c37cc38bb7238058751d3ff60712acd4134aa4c28d946c453b8b230bd6ba34c45c47a4b4d7e74aa7e3ed8dfc74cbb1d5a328bda706dd3037320e02a15421b86 0015-ada-fix-shared-linking.patch +b4afb30431ecdfd86acfd66ba857c275628b55e91cc9b21c18ca0e795b2fadfe895da801978a8e818ff9c93144075e72cf0521f3bce5c6c1d44e47e1b77b8ba4 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +6260341ed13926ce449cf351ada85d8e28fc7da63a4ae73b69c24fb2e8d0e3003ffacb1bb0f957185b8d5d7e013f777f7f696c9a1c94b2204a9b3e8274ec2f43 0017-add-fortify-headers-paths.patch +8fe954daf7e9b1d221f0536f54186bc1715e23cf3c74dfd0956c0fa22ce3b5b5e30b5e17ea584db1cc193ac7fdc72daff68c9163dbc46a837e01d25a7a4a90e0 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +fc5ce12cd70382b15317931ff0f57ae1ed10e8c09dbf2fee627bc55a268f55ebbf9ae32b89b4ef6f51e9a9b7ca32eed201245d481cde88f6eb572d40134f5f4c 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +e0d4fd0e0bf4ecfb517b60b55d73f326deda0faa75bfd07d1fcae116f91088a96caaa2dd20e2e38a93cc8ffed0aef422c0c861879c8de406364faef0cbcd50ff 0020-aarch64-disable-multilib-support.patch +7af318ea6fe14dce98b8db1f8f46a2dc9f75c2f27e63a52c62c7b47d6d62cb64748d5c2690eba772d931ff96ac089e3f03bf46b49122ffb5a03a1c186f01ae11 0021-s390x-disable-multilib-support.patch +b96dbbd0e1aa98ebc2e7eaa2a44912681e4c8bc9a129fafa53a943d67b62451b6d4fad53f92429cd4346a753527359c8c09d58836cf0968a56f5fe933496a412 0022-ppc64-le-disable-multilib-support.patch +60106cb08f27c89509ba46dc2ff0edecc1f4c7973874c85047dfdd67eabe50e3a852d7540002a09bcb6185c786a5daeba7915958c441fc92d7f16a0cce5bcdea 0023-x86_64-disable-multilib-support.patch +d55d65242af9341eef7f1e3d03fec2e2de75632a23ed83df4fe6304619f62127b42eba9d9286f7f3647e3b9bd95aaeb79023263e71ff9d58c47f3051b73d8bc2 0024-riscv-disable-multilib-support.patch +b6dda179cafbd9e7f3ef7e137b303a76491a0157d68f1504dee6611cecdca16d27ca32cbd2298da2f6301e7167b8730d70a775ee5ba88ae3773adef8421efa98 0025-always-build-libgcc_eh.a.patch +95245b6548ddca5065bac06131294028767a32740c80f707a4d1cf8653a0398305ec68e7c44a3f2912741b792d41048f03729657b0a1c1a2a7bff097c6b2fdc7 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch +ff6b8b9e1ab9b45d1853e74befb5c904cf7cd83dadb5a4b6f8c94a75e6249d1cdaa72aef73d6b1045beabc2d9012ea869d886015ec3aae561eb4ba8b9d00c2d7 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch +0582f00e8801df06e51fca45a8dc3ee62e9b6ce9245af98937f435c90c709edc7eb9071569c0e59c9a143d964fe5731b9e11b011174443b97043abddc9db1cce 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch +8683314212c0a6f49ed45ea8c74908f59d863822fa8c99e94c7e39ba3a642ca6a3167543e1ae4b58d8acd1ff97824d6e60cc432b19e6580cad2027e3a5c37603 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +60bb67f6cf4b92243dec861fba702aa5847925bf413c2c83705a0ee4ebe4c523cc295cce29666c69c9b2dec70d63def83cd9074e613b4f46e014248f53c87db4 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch +b49f72cce409f74407761fe64b028e97d58e4f236af7d9099189a8553f2ece3f30559760fab768f3d1fc4c7f89ae3ee6d687018251f3df52c9a43817c9c7c93e 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +0bd3aa81590d5f47205e193d2998bb5986cbb82adb75e3d39dcf820625bb358d380d1695ebbb18437fdd935ce350b0f5b7364a5fa7c8e07ebe8f972c8cd46cd1 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch +e8d5c4159f41fcb09e76758768d127ff366c93095137b694a405e9dbba88f2036ba64b69ac6c5c75e488be3281a1227cccbadcea2bef6f60ba0be7fc3d7db754 0033-druntime-link-against-libucontext-on-all-platforms.patch +6f530cdb1935296925ec29be7a30e4d69cebc155695db6ea30ee95ce65de7e8917e2a6148d3668974715120e7f13f734e5c36bfd35f707f4725a7556cbc1caa5 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +1dabb0c8d581ec86d8758dfa3d2f1713d915f6d927639f56b3590ed9b0885dfdf452e30ca87edac49721d2dc43d4fbdb4d178f8448e8ba5cc595457f216bf210 0035-libphobos-do-not-use-LFS64-symbols.patch +b915a0eaf7cc3e48f41f31ebbd9142760891b9ede304ff3f1dc7166f85a9e3f82017a17bb7e65824d3da07445b2c8bcd156a992eed92633362c08329b04b6cb4 0036-libgo-fix-lfs64-use.patch +0164467e66719187b6041c8d2d717a9bcd5b8c801dab6391b0e503c41e26518cc78389c97bdd2b2bc64f660f95410439aaa8a20799ec01eab17e7ba415ac1dd9 0037-loongarch-disable-multilib-support.patch +2cae2cb470b2cf469973c0ff3a7a020960cf4325502ff6c84c6b1b3514c8cacfae8452b5c79b55e657b0877fc9d81cc68db6f650156ca6d1376c1bd1a2290d8b 0038-static-PIE-ensure-static-reaches-the-linker.patch +7d73041566678fc86885877d8315481bf358858cbe54227356d5ab48623e435426ac7ff6e54d21b9fee4cc73e3f4bc7ef646d3e4ab1970e524c890cd1f735905 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +4556ead97907ec76aaa7dde450e4b6068f87268c49168eeb2af0c3df1dfa312b0a4a947b65b11fd413dae9af0beb3ef002d077c0d7f43b0bc466d3cd4348e657 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch +389eacbeba976a461af3d087d732d1c4f2a38bc5db91b935149e60ad4b210286ba76688b8a947d00f324566b6789152bf3b93a188fa2fb7ee8042786df483fed 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " diff --git a/cross/gcc-armhf/0001-posix_memalign.patch b/cross/gcc-armhf/0001-posix_memalign.patch index 04240c29c..bbc2db9ca 100644 --- a/cross/gcc-armhf/0001-posix_memalign.patch +++ b/cross/gcc-armhf/0001-posix_memalign.patch @@ -1,14 +1,14 @@ -From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001 +From 94cf7d2b3514ed3a4401861a519ead450e022afc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/35] posix_memalign +Subject: [PATCH] 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 3527283693b..c4071b64b53 100644 +index d1d79a32fc9..069c3bb8324 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ @@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644 else return NULL; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0002-gcc-poison-system-directories.patch b/cross/gcc-armhf/0002-gcc-poison-system-directories.patch index 9a1671267..de66b72d0 100644 --- a/cross/gcc-armhf/0002-gcc-poison-system-directories.patch +++ b/cross/gcc-armhf/0002-gcc-poison-system-directories.patch @@ -1,7 +1,7 @@ -From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001 +From 0d5e04099a3d2609105719f7396a4ff941b873b6 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/35] gcc: poison-system-directories +Date: Thu, 23 Jan 2025 17:12:51 -0800 +Subject: [PATCH] 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 @@ -11,23 +11,25 @@ aborted. Instead, we add the two missing items to the current scan. If the user wants this to be a failure, they can add "-Werror=poison-system-directories". +Upstream-Status: Inappropriate [OE configuration] Signed-off-by: Mark Hatle +Signed-off-by: sunil dora Signed-off-by: Khem Raj - -Upstream-Status: Pending --- gcc/common.opt | 4 ++++ - gcc/config.in | 6 ++++++ - gcc/configure | 16 ++++++++++++++++ - gcc/configure.ac | 10 ++++++++++ + gcc/config.in | 10 ++++++++++ + gcc/configure | 19 +++++++++++++++++++ + gcc/configure.ac | 16 ++++++++++++++++ gcc/doc/invoke.texi | 9 +++++++++ - gcc/gcc.cc | 2 ++ - gcc/incpath.cc | 21 +++++++++++++++++++++ - 7 files changed, 68 insertions(+) + gcc/gcc.cc | 12 ++++++++++-- + gcc/incpath.cc | 25 +++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 2 deletions(-) +diff --git a/gcc/common.opt b/gcc/common.opt +index e3fa0dacec4..bea1adc0940 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -715,6 +715,10 @@ Wreturn-local-addr +@@ -729,6 +729,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. @@ -38,9 +40,11 @@ Upstream-Status: Pending Wshadow 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 a79c51adb2b..8a531ed591c 100644 --- a/gcc/config.in +++ b/gcc/config.in -@@ -249,6 +249,12 @@ +@@ -249,6 +249,16 @@ #endif @@ -48,14 +52,20 @@ Upstream-Status: Pending +#ifndef USED_FOR_TARGET +#undef ENABLE_POISON_SYSTEM_DIRECTORIES +#endif ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef POISON_BY_DEFAULT ++#endif + + /* Define if you want all operations on RTL (the basic data structure of the 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 16965953f05..0f4a5d52c30 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1050,6 +1050,7 @@ enable_maintainer_mode +@@ -1051,6 +1051,7 @@ enable_maintainer_mode enable_link_mutex enable_link_serialization enable_version_specific_runtime_libs @@ -63,7 +73,7 @@ Upstream-Status: Pending enable_plugin enable_host_shared enable_host_pie -@@ -1823,6 +1824,8 @@ Optional Features: +@@ -1828,6 +1829,8 @@ Optional Features: --enable-version-specific-runtime-libs specify that runtime libraries should be installed in a compiler-specific directory @@ -72,7 +82,7 @@ Upstream-Status: Pending --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE -@@ -34082,6 +34085,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -83,47 +93,60 @@ Upstream-Status: Pending + enable_poison_system_directories=no +fi + -+if test "x${enable_poison_system_directories}" = "xyes"; then ++if test "x${enable_poison_system_directories}" != "xno"; then + +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++if test "$enable_poison_system_directories" = "error"; then ++$as_echo "#define POISON_BY_DEFAULT 1" >>confdefs.h ++fi + +fi + # Substitute configuration variables +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 9f67e62950a..b0e3615e5aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7555,6 +7555,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) +AC_ARG_ENABLE([poison-system-directories], + AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system header directories]),, ++ [warn for use of native system header directories (no/yes/error)]),, + [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then ++AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories]) ++if test "x${enable_poison_system_directories}" != "xno"; then ++ AC_MSG_NOTICE([poisoned directories enabled]) + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], + [1], + [Define to warn for use of native system header directories]) ++ if test $enable_poison_system_directories = "error"; then ++ AC_MSG_NOTICE([poisoned directories are fatal]) ++ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors]) ++ fi +fi + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 72009c33cd0..29aea724731 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -405,6 +405,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 -@@ -8861,6 +8862,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. + -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor + -Wno-psabi + -Wredundant-decls -Wrestrict +@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default. + Suppress warnings from casts from a pointer to an integer type of a + different size. +@opindex Wno-poison-system-directories +@item -Wno-poison-system-directories @@ -133,12 +156,27 @@ Upstream-Status: Pending +directories contain the correct headers and libraries for the target +system rather than the host. + - @opindex Wfloat-equal - @opindex Wno-float-equal - @item -Wfloat-equal + @opindex Winvalid-pch + @opindex Wno-invalid-pch + @item -Winvalid-pch +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 4fd87f2c4a1..79d4920a047 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1163,6 +1163,8 @@ proper position among the other output files. */ +@@ -909,6 +909,12 @@ proper position among the other output files. */ + #define ASM_MAP "" + #endif + ++#ifdef POISON_BY_DEFAULT ++#define POISON_IS_ERROR " -Werror=poison-system-directories" ++#else ++#define POISON_IS_ERROR ++#endif ++ + /* Assembler options for compressed debug sections. */ + #if HAVE_LD_COMPRESS_DEBUG == 0 + /* Reject if the linker cannot write compressed debug sections. */ +@@ -1166,6 +1172,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}}} \ @@ -147,6 +185,26 @@ Upstream-Status: Pending %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +@@ -1268,7 +1276,7 @@ static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ + %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR; + + /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. + +@@ -1297,7 +1305,7 @@ static const char *cc1_options = + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +- %{pthread:-fprofile-update=prefer-atomic}}}"; ++ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR; + + static const char *asm_options = + "%{-target-help:%:print-asm-header()} " +diff --git a/gcc/incpath.cc b/gcc/incpath.cc +index c1bbfd3872a..2cdbebc4c50 100644 --- a/gcc/incpath.cc +++ b/gcc/incpath.cc @@ -26,6 +26,7 @@ @@ -157,9 +215,20 @@ Upstream-Status: Pending /* Microsoft Windows does not natively support inodes. VMS has non-numeric inodes. */ -@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) +@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + cur->name, xstrerror (errno)); + reason = REASON_NOENT; + } ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ pcur = &cur->next; ++ continue; ++#endif + } + else if (!S_ISDIR (st.st_mode)) + cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0, +@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + fprintf (stderr, _("End of #embed search list.\n")); } - fprintf (stderr, _("End of search list.\n")); } + +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES @@ -168,19 +237,22 @@ Upstream-Status: Pending + struct cpp_dir *p; + + for (p = heads[INC_QUOTE]; p; p = p->next) -+ { -+ if ((!strncmp (p->name, "/usr/include", 12)) -+ || (!strncmp (p->name, "/usr/local/include", 18)) -+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) -+ || (!strncmp (p->name, "/sw/include", 11)) -+ || (!strncmp (p->name, "/opt/include", 12))) -+ warning (OPT_Wpoison_system_directories, -+ "include location \"%s\" is unsafe for " -+ "cross-compilation", -+ p->name); -+ } ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } + } +#endif } /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.50.1 + diff --git a/cross/gcc-armhf/0003-specs-turn-on-Wl-z-now-by-default.patch b/cross/gcc-armhf/0003-specs-turn-on-Wl-z-now-by-default.patch index 33e8b56f1..be6a3dc60 100644 --- a/cross/gcc-armhf/0003-specs-turn-on-Wl-z-now-by-default.patch +++ b/cross/gcc-armhf/0003-specs-turn-on-Wl-z-now-by-default.patch @@ -1,7 +1,7 @@ -From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001 +From 90e8697dd88fd99ce2cf8739e95494853005377e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default +Subject: [PATCH] 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. @@ -13,9 +13,11 @@ now by default. gcc/gcc.cc | 1 + 2 files changed, 4 insertions(+) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 29aea724731..6fb3ab70cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -18935,6 +18935,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -19477,6 +19477,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}. @@ -25,9 +27,11 @@ now by default. @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 79d4920a047..74a356fdf5e 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1161,6 +1161,7 @@ proper position among the other output files. */ +@@ -1170,6 +1170,7 @@ proper position among the other output files. */ "%{flto|flto=*:% Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, - ObjC, ObjC++, if the optimization level is > 0 +Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, + ObjC++, if the optimization level is > 0 --- gcc/c-family/c-cppbuiltin.cc | 4 ++++ gcc/doc/invoke.texi | 6 ++++++ 2 files changed, 10 insertions(+) +diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc +index 4589ee4a3a6..9edf095384c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc -@@ -1570,6 +1570,10 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -1581,6 +1581,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); @@ -22,9 +24,11 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, /* Misc. */ if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 6fb3ab70cc7..799ce073dbf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -12496,6 +12496,12 @@ also turns on the following optimization flags: +@@ -12840,6 +12840,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. @@ -37,3 +41,6 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, @opindex O3 @item -O3 Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.50.1 + diff --git a/cross/gcc-armhf/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/cross/gcc-armhf/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 819ef5e76..deb4da3dc 100644 --- a/cross/gcc-armhf/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/cross/gcc-armhf/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,8 +1,8 @@ -From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001 +From a59da582e83071de0566274d912ca6f05f4b75d0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the - linker, but always link the sanitizer libraries with --no-as-needed. +Subject: [PATCH] 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 + @@ -21,9 +21,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the gcc/gcc.cc | 28 ++++++++++++++++++++-------- 14 files changed, 36 insertions(+), 19 deletions(-) +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index 116bb4e69f3..daf99f8dce9 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h -@@ -35,6 +35,7 @@ +@@ -39,6 +39,7 @@ #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ @@ -31,6 +33,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 3fd3b831166..0b4c2dccebe 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 @@ -42,6 +46,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{O*:-O3} %{!O*:-O1} \ %{shared:-shared} \ %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index d4d389e2aa8..adccc0b11c2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -52,6 +58,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 4c4e31efa39..3c17ac6eade 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 @@ -78,6 +86,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the #endif #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index 7abfda53049..ceb8f855b7d 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 @@ -89,6 +99,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index abe714711bf..3ca128a79f5 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 @@ -99,6 +111,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index a2494c214c4..e1a5d530cdf 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -110,6 +124,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5a82508c113..6eee7cdc603 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 @@ -120,6 +136,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 9060c940a44..282c77b6a7b 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see @@ -130,6 +148,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ -X \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 0316d8cb65d..139e1b6796c 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -378,13 +378,13 @@ extern int dot_symbols; @@ -148,6 +168,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!static-pie: \ %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ +diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h +index afb5c6ad867..b64638fb25b 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -159,6 +181,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 2c3bca5dfcb..b90661247a4 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 @@ -170,6 +194,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 6d928846895..3cc05bb7240 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); @@ -181,9 +207,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!static: \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 74a356fdf5e..fc9c7d15b04 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -771,8 +771,11 @@ proper position among the other output files. */ +@@ -774,8 +774,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -197,7 +225,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -807,8 +810,11 @@ proper position among the other output files. */ +@@ -810,8 +813,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -211,7 +239,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -825,8 +831,11 @@ proper position among the other output files. */ +@@ -828,8 +834,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +253,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -841,8 +850,11 @@ proper position among the other output files. */ +@@ -844,8 +853,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 @@ -239,3 +267,6 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-armhf/0006-Enable-Wformat-and-Wformat-security-by-default.patch b/cross/gcc-armhf/0006-Enable-Wformat-and-Wformat-security-by-default.patch index b4d580f85..b8851777b 100644 --- a/cross/gcc-armhf/0006-Enable-Wformat-and-Wformat-security-by-default.patch +++ b/cross/gcc-armhf/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -1,15 +1,17 @@ -From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001 +From 35c02ea8267e193b92f30495c94ee1e8e5c2be8e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH] 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 75b6531860e..78830ce4b42 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -774,7 +774,7 @@ Warn about function calls with format strings that write past the end +@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end of the destination region. Wformat-security @@ -18,7 +20,7 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -799,7 +799,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -27,3 +29,6 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about printf/scanf/strftime/strfmon format string anomalies. Wframe-address +-- +2.50.1 + diff --git a/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch index 140685d7b..eda9ab096 100644 --- a/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch @@ -1,16 +1,18 @@ -From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/35] Enable -Wtrampolines by default. +From 0b82663fd2f054e07e116c4dcc5019f7e969cd3e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:44:20 -0700 +Subject: [PATCH] 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 bea1adc0940..e65a575d9f8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -811,7 +811,7 @@ Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers. +@@ -829,7 +829,7 @@ Common Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wa + Warn if a comparison always evaluates to true or false. Wtrampolines -Common Var(warn_trampolines) Warning @@ -18,3 +20,6 @@ Subject: [PATCH 07/35] Enable -Wtrampolines by default. Warn whenever a trampoline is generated. Wtrivial-auto-var-init +-- +2.50.1 + diff --git a/cross/gcc-armhf/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/cross/gcc-armhf/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch deleted file mode 100644 index e85284ff0..000000000 --- a/cross/gcc-armhf/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and - -ffreestanding Change the buffer size. - ---- - gcc/gcc.cc | 8 +++++++- - gcc/params.opt | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1000,6 +1000,12 @@ proper position among the other output files. */ - #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" - #endif - -+#ifdef ENABLE_DEFAULT_SSP -+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " -+#else -+#define NO_SSP_SPEC "" -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1305,7 +1311,7 @@ static const char *cc1_options = - %{-version:--version}\ - %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ -- %{fsyntax-only:-o %j} %{-param*}\ -+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ - %{coverage:-fprofile-arcs -ftest-coverage}\ - %{fprofile-arcs|fcondition-coverage|fprofile-generate*|coverage:\ - %{!fprofile-update=single:\ ---- a/gcc/params.opt -+++ b/gcc/params.opt -@@ -1013,7 +1013,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim - The maximum number of SSA_NAME assignments to follow in determining a value. - - -param=ssp-buffer-size= --Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization -+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization - The lower bound for a buffer to be considered for stack smashing protection. - - -param=stack-clash-protection-guard-size= diff --git a/cross/gcc-armhf/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch b/cross/gcc-armhf/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch new file mode 100644 index 000000000..8997916ca --- /dev/null +++ b/cross/gcc-armhf/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch @@ -0,0 +1,39 @@ +From 3acf32fc94fd447874b2f1447a19a65f0905bff5 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:49:03 -0700 +Subject: [PATCH] gcc: disable SSP on -ffreestanding, -nostdlib and + -nodefaultlibs + +--- + gcc/gcc.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9c7d15b04..7b0d3d2743b 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1009,6 +1009,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1314,7 +1320,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +-- +2.50.1 + diff --git a/cross/gcc-armhf/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch b/cross/gcc-armhf/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch new file mode 100644 index 000000000..8b25ba72d --- /dev/null +++ b/cross/gcc-armhf/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch @@ -0,0 +1,25 @@ +From bb98973bdb5fe8bd040e238afe92845203929b59 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:50:42 -0700 +Subject: [PATCH] gcc: params: set default ssp-buffer-size to 4 + +--- + gcc/params.opt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/params.opt b/gcc/params.opt +index 64e453d29b7..bba3fd574f2 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -1064,7 +1064,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-armhf/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch similarity index 88% rename from cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch rename to cross/gcc-armhf/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index f4dd52f19..c903a5cce 100644 --- a/cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-armhf/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,8 +1,8 @@ -From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001 +From f89d8e95b809d02eceee416b463200c9abb2b33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during - gcc bootstrapping. +Subject: [PATCH] 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 12d34910830..61b13762b71 100644 +index 7f84a99533e..a4c6284f788 100644 --- a/libstdc++-v3/po/Makefile.am +++ b/libstdc++-v3/po/Makefile.am @@ -38,6 +38,7 @@ MSGFMT = msgfmt @@ -50,5 +50,5 @@ index 8e93445acd2..d6ff06e5ddb 100644 all-local: all-local-$(USE_NLS) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-armhf/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch similarity index 73% rename from cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch rename to cross/gcc-armhf/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch index f56d41a57..48b22a5dc 100644 --- a/cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-armhf/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,17 +1,17 @@ -From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001 +From b45303198567828a5240baf932a8c13255f35d20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/35] Don't declare asprintf if defined as a macro. +Subject: [PATCH] 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 1d5c779fcff..19e3cb1e31c 100644 +index d4e8791b14b..c074980ed80 100644 --- a/include/libiberty.h +++ b/include/libiberty.h -@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *, +@@ -678,8 +678,11 @@ extern void *bsearch_r (const void *, const void *, /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. */ @@ -24,5 +24,5 @@ index 1d5c779fcff..19e3cb1e31c 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-armhf/0012-libiberty-copy-PIC-objects-during-build-process.patch similarity index 66% rename from cross/gcc-riscv64/0011-libiberty-copy-PIC-objects-during-build-process.patch rename to cross/gcc-armhf/0012-libiberty-copy-PIC-objects-during-build-process.patch index b12d4f94b..ff49be1c6 100644 --- a/cross/gcc-riscv64/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-armhf/0012-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,17 +1,17 @@ -From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001 +From 68e2c9356221ba30b27840b9449f742505584cf1 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/35] libiberty: copy PIC objects during build process +Subject: [PATCH] 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 72608f3e4a7..58356884728 100644 +index ce54d88278d..10c212a1ad3 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) +@@ -266,6 +266,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ @@ -20,5 +20,5 @@ index 72608f3e4a7..58356884728 100644 else true; fi -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0012-libgcc_s.patch b/cross/gcc-armhf/0013-libgcc_s.patch similarity index 76% rename from cross/gcc-armv7/0012-libgcc_s.patch rename to cross/gcc-armhf/0013-libgcc_s.patch index 8189f8491..99152585f 100644 --- a/cross/gcc-armv7/0012-libgcc_s.patch +++ b/cross/gcc-armhf/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001 +From ca482f8c9cac9617855f908dd30d3d6144e850a0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 12/35] libgcc_s +Subject: [PATCH] libgcc_s --- gcc/config/i386/i386-expand.cc | 4 ++-- @@ -9,9 +9,11 @@ Subject: [PATCH 12/35] libgcc_s libgcc/config/i386/t-linux | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) +diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc +index cdfd94d3c73..a3a6c988833 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc -@@ -13089,10 +13089,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -13643,10 +13643,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -24,6 +26,8 @@ Subject: [PATCH 12/35] libgcc_s call_expr = build_call_expr (fndecl, 0); return expand_expr (call_expr, target, mode, EXPAND_NORMAL); } +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index 2484dc839bf..e980030ef23 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -63,7 +63,7 @@ __cpu_indicator_init (void) @@ -37,6 +41,8 @@ Subject: [PATCH 12/35] libgcc_s +int __cpu_indicator_init_local (void) + __attribute__ ((weak, alias ("__cpu_indicator_init"))); #endif +diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux +index 8506a635790..564296f788e 100644 --- a/libgcc/config/i386/t-linux +++ b/libgcc/config/i386/t-linux @@ -3,5 +3,5 @@ @@ -46,3 +52,6 @@ Subject: [PATCH 12/35] libgcc_s -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.50.1 + diff --git a/cross/gcc-armv7/0013-nopie.patch b/cross/gcc-armhf/0014-nopie.patch similarity index 79% rename from cross/gcc-armv7/0013-nopie.patch rename to cross/gcc-armhf/0014-nopie.patch index 4a9ea0770..7117a9434 100644 --- a/cross/gcc-armv7/0013-nopie.patch +++ b/cross/gcc-armhf/0014-nopie.patch @@ -1,16 +1,18 @@ -From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001 +From 6dfb241ae9f879f4945941273dd73eb13f127b06 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 13/35] nopie +Subject: [PATCH] nopie --- gcc/configure | 25 +++++++++++++++++++++++++ gcc/configure.ac | 11 +++++++++++ 2 files changed, 36 insertions(+) +diff --git a/gcc/configure b/gcc/configure +index 0f4a5d52c30..343563c8948 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \ +@@ -34586,6 +34586,29 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 $as_echo "$gcc_cv_no_pie" >&6; } @@ -40,7 +42,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then +@@ -34603,6 +34626,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -49,9 +51,11 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b0e3615e5aa..b3948469d17 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -7802,6 +7802,15 @@ AC_CACHE_CHECK([for -no-pie option], [gcc_cv_no_pie=yes], [gcc_cv_no_pie=no]) LDFLAGS="$saved_LDFLAGS"]) @@ -67,7 +71,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then +@@ -7819,6 +7828,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -76,3 +80,6 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +-- +2.50.1 + diff --git a/cross/gcc-armv7/0014-ada-fix-shared-linking.patch b/cross/gcc-armhf/0015-ada-fix-shared-linking.patch similarity index 90% rename from cross/gcc-armv7/0014-ada-fix-shared-linking.patch rename to cross/gcc-armhf/0015-ada-fix-shared-linking.patch index ff6e42921..a893502b7 100644 --- a/cross/gcc-armv7/0014-ada-fix-shared-linking.patch +++ b/cross/gcc-armhf/0015-ada-fix-shared-linking.patch @@ -1,14 +1,14 @@ -From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001 +From 8ac6aeca5d6192ee16b959bd8c1903a52d408a55 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 14/35] ada: fix shared linking +Subject: [PATCH] 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 f2126441208..22cfa9c641f 100644 +index 9e3385ca94f..2c0cca6e480 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; @@ -38,5 +38,5 @@ index f2126441208..22cfa9c641f 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-armhf/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch similarity index 70% rename from cross/gcc-armhf/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch rename to cross/gcc-armhf/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index ddea4a05b..a6adebb1f 100644 --- a/cross/gcc-armhf/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-armhf/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,12 +1,14 @@ -From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001 +From 7323d68ae46fc8e33c0746799d820a4e4c8c8b72 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + 1 file changed, 1 insertion(+) +diff --git a/Makefile.in b/Makefile.in +index b1ed67d3d4f..1e039c20550 100644 --- a/Makefile.in +++ b/Makefile.in @@ -179,6 +179,7 @@ BUILD_EXPORTS = \ @@ -17,3 +19,6 @@ Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing LDFLAGS="$(LDFLAGS_FOR_BUILD)" # This is the list of directories to built for the host system. +-- +2.50.1 + diff --git a/cross/gcc-armhf/0016-add-fortify-headers-paths.patch b/cross/gcc-armhf/0017-add-fortify-headers-paths.patch similarity index 80% rename from cross/gcc-armhf/0016-add-fortify-headers-paths.patch rename to cross/gcc-armhf/0017-add-fortify-headers-paths.patch index b554e0251..b4ecd2fd5 100644 --- a/cross/gcc-armhf/0016-add-fortify-headers-paths.patch +++ b/cross/gcc-armhf/0017-add-fortify-headers-paths.patch @@ -1,14 +1,14 @@ -From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001 +From eaf89c8c91806905c6e1ec9519cbfb56296204b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 16/35] add fortify-headers paths +Subject: [PATCH] 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 e3aca79cccc..b3537b8fbeb 100644 +index d6280a4d4dd..ba69fb9fad7 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -21,5 +21,5 @@ index e3aca79cccc..b3537b8fbeb 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-armhf/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch similarity index 68% rename from cross/gcc-riscv64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch rename to cross/gcc-armhf/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index 4796a055d..84731bb57 100644 --- a/cross/gcc-riscv64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-armhf/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,9 +1,9 @@ -From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001 +From bdedcd9db7b8291637c5147dd82e8a9e3f5f9c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 21 Aug 2020 07:03:00 +0000 -Subject: [PATCH 17/35] 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] 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. @@ -12,9 +12,11 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We gcc/gcc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 7b0d3d2743b..e46e976a2e8 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1008,8 +1008,7 @@ proper position among the other output files. */ +@@ -1017,8 +1017,7 @@ proper position among the other output files. */ #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP @@ -24,3 +26,6 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-armhf/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch similarity index 84% rename from cross/gcc-riscv64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch rename to cross/gcc-armhf/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index b829e5b34..b703be7a7 100644 --- a/cross/gcc-riscv64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-armhf/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,16 +1,18 @@ -From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001 +From 586ce3614d4fc3fbeccf01659114a4643c1879c8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- gcc/gcc.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e46e976a2e8..607c8ca1d42 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -772,10 +772,10 @@ proper position among the other output files. */ +@@ -775,10 +775,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 "}" \ @@ -23,7 +25,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -811,10 +811,10 @@ proper position among the other output files. */ +@@ -814,10 +814,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 "}" \ @@ -36,7 +38,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -832,10 +832,10 @@ proper position among the other output files. */ +@@ -835,10 +835,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 "}" \ @@ -49,7 +51,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -851,10 +851,10 @@ proper position among the other output files. */ +@@ -854,10 +854,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 "}" \ @@ -62,3 +64,6 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0019-aarch64-disable-multilib-support.patch b/cross/gcc-armhf/0020-aarch64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-aarch64/0019-aarch64-disable-multilib-support.patch rename to cross/gcc-armhf/0020-aarch64-disable-multilib-support.patch index 5a8148feb..f2ad4bd64 100644 --- a/cross/gcc-aarch64/0019-aarch64-disable-multilib-support.patch +++ b/cross/gcc-armhf/0020-aarch64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001 +From 0ca7f92018d0bc04a72655f3b130c9aaeea1b771 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:12:55 +0000 -Subject: [PATCH 19/35] aarch64: disable multilib support +Subject: [PATCH] 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 57bf4100fcd..172894b57ef 100644 +index 70e36b3299e..e00c3becd3f 100644 --- a/gcc/config/aarch64/t-aarch64-linux +++ b/gcc/config/aarch64/t-aarch64-linux @@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm @@ -22,5 +22,5 @@ index 57bf4100fcd..172894b57ef 100644 MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0020-s390x-disable-multilib-support.patch b/cross/gcc-armhf/0021-s390x-disable-multilib-support.patch similarity index 85% rename from cross/gcc-aarch64/0020-s390x-disable-multilib-support.patch rename to cross/gcc-armhf/0021-s390x-disable-multilib-support.patch index ef2f449a4..7b71aa3bc 100644 --- a/cross/gcc-aarch64/0020-s390x-disable-multilib-support.patch +++ b/cross/gcc-armhf/0021-s390x-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001 +From b48898c8fbd7828b81f407c74c25cf8e07fb73a4 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:13:59 +0000 -Subject: [PATCH 20/35] s390x: disable multilib support +Subject: [PATCH] s390x: disable multilib support multilib is not supported on Alpine GCC at present --- @@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0021-ppc64-le-disable-multilib-support.patch b/cross/gcc-armhf/0022-ppc64-le-disable-multilib-support.patch similarity index 95% rename from cross/gcc-armv7/0021-ppc64-le-disable-multilib-support.patch rename to cross/gcc-armhf/0022-ppc64-le-disable-multilib-support.patch index dbdc78828..5281a006c 100644 --- a/cross/gcc-armv7/0021-ppc64-le-disable-multilib-support.patch +++ b/cross/gcc-armhf/0022-ppc64-le-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001 +From 158d93ce86f3d311ce489d0740326027068ca721 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:33 +0000 -Subject: [PATCH 21/35] ppc64[le]: disable multilib support +Subject: [PATCH] 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 01a94242308..b3a76379c03 100644 +index f56b47c268e..c5f757a6284 100644 --- a/gcc/config/rs6000/t-linux64 +++ b/gcc/config/rs6000/t-linux64 @@ -28,8 +28,8 @@ @@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644 +MULTILIB_OSDIRNAMES += m32=../lib32 MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0022-x86_64-disable-multilib-support.patch b/cross/gcc-armhf/0023-x86_64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-aarch64/0022-x86_64-disable-multilib-support.patch rename to cross/gcc-armhf/0023-x86_64-disable-multilib-support.patch index 2b2f3e7f3..1e74e9462 100644 --- a/cross/gcc-aarch64/0022-x86_64-disable-multilib-support.patch +++ b/cross/gcc-armhf/0023-x86_64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001 +From 6957fc21caca80f5e01db15df6dc8de46c85167b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:54 +0000 -Subject: [PATCH 22/35] x86_64: disable multilib support +Subject: [PATCH] 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 138956b0962..bc03dab874f 100644 +index 64a4a20e64f..9a8eb8dd8d1 100644 --- a/gcc/config/i386/t-linux64 +++ b/gcc/config/i386/t-linux64 @@ -33,6 +33,6 @@ @@ -22,5 +22,5 @@ index 138956b0962..bc03dab874f 100644 +MULTILIB_OSDIRNAMES+= m32=../lib32 MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0023-riscv-disable-multilib-support.patch b/cross/gcc-armhf/0024-riscv-disable-multilib-support.patch similarity index 90% rename from cross/gcc-armhf/0023-riscv-disable-multilib-support.patch rename to cross/gcc-armhf/0024-riscv-disable-multilib-support.patch index eb9ba90fc..cc136a04f 100644 --- a/cross/gcc-armhf/0023-riscv-disable-multilib-support.patch +++ b/cross/gcc-armhf/0024-riscv-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001 +From fdcbe7ee4ce81cdf247966385c8d521ac3f5a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 3 Jan 2022 07:14:48 +0100 -Subject: [PATCH 23/35] riscv: disable multilib support +Subject: [PATCH] riscv: disable multilib support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -42,6 +42,8 @@ library. gcc/config/riscv/t-linux | 7 +++++-- 2 files changed, 5 insertions(+), 10 deletions(-) +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 282c77b6a7b..07adae3d59c 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see @@ -56,6 +58,8 @@ library. - "/usr/lib/ " - -#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi +diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux +index a6f64f88d25..f88776ec520 100644 --- a/gcc/config/riscv/t-linux +++ b/gcc/config/riscv/t-linux @@ -1,5 +1,8 @@ @@ -69,3 +73,6 @@ library. +MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) +-- +2.50.1 + diff --git a/cross/gcc-armhf/0025-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-armhf/0025-ada-libgnarl-compatibility-for-musl.patch deleted file mode 100644 index b7c1c5f2f..000000000 --- a/cross/gcc-armhf/0025-ada-libgnarl-compatibility-for-musl.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 25/35] ada: libgnarl compatibility for musl - ---- - gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ - gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- - 2 files changed, 3 insertions(+), 61 deletions(-) - -diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads -index 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 - PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; - -- function pthread_rwlockattr_setkind_np -- (attr : access pthread_rwlockattr_t; -- pref : int) return int; -- pragma Import -- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); -- - function pthread_rwlock_init - (mutex : access pthread_rwlock_t; - attr : access pthread_rwlockattr_t) return int; -@@ -470,11 +464,6 @@ package System.OS_Interface is - protocol : int) return int; - pragma Import (C, pthread_mutexattr_setprotocol); - -- function pthread_mutexattr_setprioceiling -- (attr : access pthread_mutexattr_t; -- prioceiling : int) return int; -- pragma Import (C, pthread_mutexattr_setprioceiling); -- - type struct_sched_param is record - 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 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 - pragma Import - (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); - -- function GNAT_has_cap_sys_nice return C.int; -- pragma Import -- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); - -- We do not have pragma Linker_Options ("-lcap"); here, because this - -- library is not present on many Linux systems. 'libcap' is the Linux - -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is - -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on - -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. - -- function Get_Ceiling_Support return Boolean; -- -- Get the value of the Ceiling_Support constant (see below). -- -- Note well: If this function or related code is modified, it should be -- -- tested by hand, because automated testing doesn't exercise it. -- -- ------------------------- -- -- Get_Ceiling_Support -- -- ------------------------- -- -- function Get_Ceiling_Support return Boolean is -- Ceiling_Support : Boolean := False; -- begin -- if Locking_Policy /= 'C' then -- return False; -- end if; -- -- declare -- function geteuid return Integer; -- pragma Import (C, geteuid, "geteuid"); -- Superuser : constant Boolean := geteuid = 0; -- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; -- pragma Assert (Has_Cap in 0 | 1); -- begin -- Ceiling_Support := Superuser or else Has_Cap = 1; -- end; -- -- return Ceiling_Support; -- end Get_Ceiling_Support; -- -- pragma Warnings (Off, "non-preelaborable call not allowed*"); -- Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-preelaborable call not allowed*"); - -- True if the locking policy is Ceiling_Locking, and the current process - -- has permission to use this policy. The process has permission if it is - -- running as 'root', or if the capability was set by the setcap command, -@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is - -- Init_Mutex -- - ---------------- - -+ pragma Warnings (Off, "formal parameter * is not referenced"); - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is -+ pragma Warnings (On, "formal parameter * is not referenced"); - Mutex_Attr : aliased pthread_mutexattr_t; - Result, Result_2 : C.int; - -@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is - return Result; - end if; - -- if Ceiling_Support then -- Result := pthread_mutexattr_setprotocol -- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); -- pragma Assert (Result = 0); -- -- Result := pthread_mutexattr_setprioceiling -- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); -- pragma Assert (Result = 0); -- -- elsif Locking_Policy = 'I' then -+ if Locking_Policy = 'I' then - Result := pthread_mutexattr_setprotocol - (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); - pragma Assert (Result = 0); -@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is - Result := pthread_rwlockattr_init (RWlock_Attr'Access); - pragma Assert (Result = 0); - -- Result := pthread_rwlockattr_setkind_np -- (RWlock_Attr'Access, -- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); -- pragma Assert (Result = 0); -- - Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); - - pragma Assert (Result in 0 | ENOMEM); --- -2.41.0 - diff --git a/cross/gcc-armhf/0024-always-build-libgcc_eh.a.patch b/cross/gcc-armhf/0025-always-build-libgcc_eh.a.patch similarity index 78% rename from cross/gcc-armhf/0024-always-build-libgcc_eh.a.patch rename to cross/gcc-armhf/0025-always-build-libgcc_eh.a.patch index 5d508ea08..5b21d4dd1 100644 --- a/cross/gcc-armhf/0024-always-build-libgcc_eh.a.patch +++ b/cross/gcc-armhf/0025-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001 +From 6f63901256443978a2c3746e72bd5762166a7790 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 24/35] always build libgcc_eh.a +Subject: [PATCH] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -9,9 +9,11 @@ highly inspired by: libgcc/Makefile.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index 0719fd0615d..80bb8f1622f 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -967,8 +967,9 @@ ifneq ($(LIBUNWIND),) +@@ -971,8 +971,9 @@ ifneq ($(LIBUNWIND),) all: libunwind.a endif @@ -22,7 +24,7 @@ highly inspired by: ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1173,10 +1174,6 @@ install-libunwind: +@@ -1177,10 +1178,6 @@ install-libunwind: install-shared: $(mkinstalldirs) $(DESTDIR)$(inst_libdir) @@ -33,7 +35,7 @@ highly inspired by: $(subst @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_base_name@,libgcc_s,$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -1193,6 +1190,10 @@ ifeq ($(enable_gcov),yes) +@@ -1197,6 +1194,10 @@ ifeq ($(enable_gcov),yes) $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a endif @@ -44,3 +46,6 @@ highly inspired by: parts="$(INSTALL_PARTS)"; \ for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.50.1 + diff --git a/cross/gcc-armhf/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch b/cross/gcc-armhf/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch new file mode 100644 index 000000000..e8fb24481 --- /dev/null +++ b/cross/gcc-armhf/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch @@ -0,0 +1,59 @@ +From a365def37f5de93ad85588d8e2c02c0df28e88d6 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:09:02 -0700 +Subject: [PATCH] ada: libgnarl: remove use of glibc-specific + pthread_rwlockattr_setkind_np + +musl's thread library does not implement it + +Signed-off-by: Ariadne Conill +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 10 ---------- + gcc/ada/libgnarl/s-taprop__linux.adb | 7 ------- + 2 files changed, 17 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 7aeb15da523..5551b701e5a 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -402,16 +402,6 @@ package System.OS_Interface is + (attr : access pthread_rwlockattr_t) return int; + pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy"); + +- PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0; +- PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; +- +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb +index 8f4c835baa7..6df36c7d8f4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -409,16 +409,9 @@ package body System.Task_Primitives.Operations is + Result : C.int; + + begin +- -- Set the rwlock to prefer writer to avoid writers starvation +- + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); +-- +2.50.1 + diff --git a/cross/gcc-armhf/0026-ada-musl-support-fixes.patch b/cross/gcc-armhf/0026-ada-musl-support-fixes.patch deleted file mode 100644 index 0be683fa6..000000000 --- a/cross/gcc-armhf/0026-ada-musl-support-fixes.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 26/35] ada: musl support fixes - ---- - gcc/ada/Makefile.rtl | 16 ++++++++-------- - gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- - gcc/ada/adaint.h | 10 ++++------ - gcc/ada/terminals.c | 8 ++++---- - 4 files changed, 35 insertions(+), 33 deletions(-) - ---- a/gcc/ada/Makefile.rtl -+++ b/gcc/ada/Makefile.rtl -@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) - s-intman.adb - #include - #endif -+ -+#if defined (linux) || defined(__linux__) -+#define _GNU_SOURCE 1 -+#include -+#endif - - #ifdef __PikeOS__ - #define __BSD_VISIBLE 1 -@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void) - #endif - - #if defined (__linux__) --#include - - /* glibc versions earlier than 2.7 do not define the routines to handle - dynamically allocated CPU sets. For these targets, we use the static -@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void) - - /* Dynamic cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count) - { - return CPU_ALLOC (count); -@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { -- CPU_FREE (set); -+ CPU_FREE ((cpu_set_t *) set); - } - - void --__gnat_cpu_zero (size_t count, cpu_set_t *set) -+__gnat_cpu_zero (size_t count, void *set) - { -- CPU_ZERO_S (count, set); -+ CPU_ZERO_S (count, (cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET_S (cpu - 1, count, set); -+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); - } - - #else /* !CPU_ALLOC */ - - /* Static cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) - { -- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); -+ return xmalloc (sizeof (cpu_set_t)); - } - - size_t -@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { - free (set); - } - - void --__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) - { -- CPU_ZERO (set); -+ CPU_ZERO ((cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET (cpu - 1, set); -+ CPU_SET (cpu - 1, (cpu_set_t *) set); - } - #endif /* !CPU_ALLOC */ - #endif /* __linux__ */ ---- a/gcc/ada/adaint.h -+++ b/gcc/ada/adaint.h -@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void); - - /* Routines for interface to required CPU set primitives */ - --#include -- --extern cpu_set_t *__gnat_cpu_alloc (size_t); -+extern void * __gnat_cpu_alloc (size_t); - extern size_t __gnat_cpu_alloc_size (size_t); --extern void __gnat_cpu_free (cpu_set_t *); --extern void __gnat_cpu_zero (size_t, cpu_set_t *); --extern void __gnat_cpu_set (int, size_t, cpu_set_t *); -+extern void __gnat_cpu_free (void *); -+extern void __gnat_cpu_zero (size_t, void *); -+extern void __gnat_cpu_set (int, size_t, void *); - #endif - - #if defined (_WIN32) ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1134,7 +1134,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) -- 2- getpt (USE_GETPT) -+ 2- posix_openpt (USE_POSIX_OPENPT) - 3- openpty (USE_OPENPTY) - - When using the cloning device method, the macro USE_CLONE_DEVICE should -@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, - #if defined (__APPLE__) || defined (BSD) - #define USE_OPENPTY - #elif defined (__linux__) --#define USE_GETPT -+#define USE_POSIX_OPENPT - #elif defined (__sun__) - #define USE_CLONE_DEVICE "/dev/ptmx" - #elif defined (_AIX) -@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { - int master_fd = -1; - char *slave_name = NULL; - --#ifdef USE_GETPT -- master_fd = getpt (); -+#if defined(USE_POSIX_OPENPT) -+ master_fd = posix_openpt(O_RDWR | O_NOCTTY); - #elif defined (USE_OPENPTY) - status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); - #elif defined (USE_CLONE_DEVICE) diff --git a/cross/gcc-armhf/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch b/cross/gcc-armhf/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch new file mode 100644 index 000000000..c138a6034 --- /dev/null +++ b/cross/gcc-armhf/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch @@ -0,0 +1,50 @@ +From e1572457f94a26da9a588a36afa3eb0e74122c34 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:13:19 -0700 +Subject: [PATCH] ada: libgnarl: use posix_openpt instead of glibc-specific + getpt to open a pty + +musl only implements posix_openpt(3), not the older glibc-specific getpt() +and glibc implements both for ages. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/terminals.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index 89f887556c0..93557fe2631 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1134,7 +1134,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) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + #if defined (__APPLE__) || defined (BSD) + #define USE_OPENPTY + #elif defined (__linux__) +-#define USE_GETPT ++#define USE_POSIX_OPENPT + #elif defined (__sun__) + #define USE_CLONE_DEVICE "/dev/ptmx" + #elif defined (_AIX) +@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) +-- +2.50.1 + diff --git a/cross/gcc-armhf/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch b/cross/gcc-armhf/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch new file mode 100644 index 000000000..0bf61bd9f --- /dev/null +++ b/cross/gcc-armhf/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch @@ -0,0 +1,54 @@ +From 4f26d4bfedb7f942b69ca4743f053c3a690a0b4a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:18:49 -0700 +Subject: [PATCH] ada: libgnarl: adaint: fix sched.h inclusion for musl + +Signed-off-by: Ariadne Conill +--- + gcc/ada/adaint.c | 6 +++++- + gcc/ada/adaint.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 1fcfae165a7..67318e647ed 100644 +--- a/gcc/ada/adaint.c ++++ b/gcc/ada/adaint.c +@@ -95,6 +95,11 @@ + #include + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 + #endif +@@ -3476,7 +3481,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 3df12b5f956..26a489f2b78 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -40,6 +40,11 @@ extern "C" { + #include "mingw32.h" + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #include + + /* Constants used for the form parameter encoding values */ +-- +2.50.1 + diff --git a/cross/gcc-armv7/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-armhf/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch similarity index 86% rename from cross/gcc-armv7/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch rename to cross/gcc-armhf/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch index 0b92854c4..32c8c8724 100644 --- a/cross/gcc-armv7/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +++ b/cross/gcc-armhf/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch @@ -1,14 +1,14 @@ -From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001 +From 6592e702844d31bcef17c340bfc13e0e1be9f132 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 9 Dec 2020 07:42:06 +0000 -Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in +Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in LINK_GCC_C_SEQUENCE_SPEC [PR81358] This fixes issues with RISC-V. --- Makefile.in | 1 + - gcc/config/gnu-user.h | 12 +++++++++++- gcc/config.in | 6 ++++++ + gcc/config/gnu-user.h | 12 +++++++++++- gcc/configure | 31 ++++++++++++++++++++++++++++++- gcc/configure.ac | 21 +++++++++++++++++++++ gcc/doc/install.texi | 8 ++++++++ @@ -17,9 +17,11 @@ This fixes issues with RISC-V. gcc/gcc.cc | 12 +++++++++++- 9 files changed, 102 insertions(+), 5 deletions(-) +diff --git a/Makefile.in b/Makefile.in +index 1e039c20550..20f535a306a 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -237,6 +237,7 @@ HOST_EXPORTS = \ +@@ -238,6 +238,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; \ @@ -27,6 +29,25 @@ This fixes issues with RISC-V. HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ +diff --git a/gcc/config.in b/gcc/config.in +index 8a531ed591c..40045ff35a5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -131,6 +131,12 @@ + #endif + + ++/* Define if libatomic should always be linked. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_AUTOLINK_LIBATOMIC ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 3c17ac6eade..0426efdb8c3 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 @@ -49,24 +70,11 @@ This fixes issues with RISC-V. %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" #undef LINK_GCC_C_SEQUENCE_SPEC ---- a/gcc/config.in -+++ b/gcc/config.in -@@ -131,6 +131,12 @@ - #endif - - -+/* Define if libatomic should always be linked. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_AUTOLINK_LIBATOMIC -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET +diff --git a/gcc/configure b/gcc/configure +index 343563c8948..54300a2a867 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1002,6 +1002,7 @@ with_changes_root_url +@@ -1003,6 +1003,7 @@ with_changes_root_url enable_languages with_multilib_list with_multilib_generator @@ -74,7 +82,7 @@ This fixes issues with RISC-V. with_zstd with_zstd_include with_zstd_lib -@@ -1739,6 +1740,9 @@ Optional Features: +@@ -1742,6 +1743,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 @@ -84,7 +92,7 @@ This fixes issues with RISC-V. --disable-rpath do not hardcode runtime library paths --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling -@@ -8380,7 +8384,6 @@ else +@@ -8400,7 +8404,6 @@ else fi @@ -92,7 +100,7 @@ This fixes issues with RISC-V. # Check whether --with-multilib-generator was given. if test "${with_multilib_generator+set}" = set; then : withval=$with_multilib_generator; : -@@ -8388,6 +8391,32 @@ else +@@ -8408,6 +8411,32 @@ else with_multilib_generator=default fi @@ -125,9 +133,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b3948469d17..81c070830e2 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -1215,6 +1215,27 @@ AC_ARG_WITH(multilib-generator, +@@ -1227,6 +1227,27 @@ AC_ARG_WITH(multilib-generator, :, with_multilib_generator=default) @@ -155,9 +165,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs # ------------------------- +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 3e9e09b4ae3..6e7b756be61 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi -@@ -2525,6 +2525,14 @@ files, but these changed header paths may conflict with some compilation +@@ -2617,6 +2617,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}. @@ -172,6 +184,8 @@ This fixes issues with RISC-V. @item --with-glibc-version=@var{major}.@var{minor} 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 a96700c0d38..16deedca64d 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -189,6 +203,8 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in +index eccc4d88493..4ca4c610571 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -206,9 +222,11 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 607c8ca1d42..e9f78f0f4c1 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -991,13 +991,23 @@ proper position among the other output files. */ +@@ -1000,13 +1000,23 @@ proper position among the other output files. */ # define ASM_DEBUG_OPTION_SPEC "" #endif @@ -233,3 +251,6 @@ This fixes issues with RISC-V. #endif #ifdef ENABLE_DEFAULT_SSP +-- +2.50.1 + diff --git a/cross/gcc-armv7/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-armhf/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch similarity index 90% rename from cross/gcc-armv7/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch rename to cross/gcc-armhf/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch index f92fc7bf4..5aed9caf5 100644 --- a/cross/gcc-armv7/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch +++ b/cross/gcc-armhf/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -1,8 +1,8 @@ -From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 +From 952070c1616f231a810af2da50264713d7587b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 29 Aug 2021 12:23:34 +0200 -Subject: [PATCH 28/35] configure: fix detection of atomic builtins in - libatomic configure script +Subject: [PATCH] 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 a92ae9e8309..90b579ca4d8 100644 +index 6db039d6e8b..2751b5c1387 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -30,6 +30,26 @@ @@ -53,5 +53,5 @@ index a92ae9e8309..90b579ca4d8 100644 alpha*) # fenv.c needs this option to generate inexact exceptions. -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-armhf/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch similarity index 78% rename from cross/gcc-armv7/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch rename to cross/gcc-armhf/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch index 4418cd5b5..2b7259a4d 100644 --- a/cross/gcc-armv7/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +++ b/cross/gcc-armhf/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch @@ -1,15 +1,15 @@ -From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001 +From 896b002a2afacb4d75d573aca4ae53b499df19cd Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 30 Jun 2022 16:44:51 +0000 -Subject: [PATCH 29/35] libstdc++: do not throw exceptions for non-C locales on - musl targets +Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl + targets --- libstdc++-v3/config/locale/generic/c_locale.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc -index 8849d78fdfa..aff467f98fe 100644 +index bfd02b5c2c6..16f9e84d66f 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 @@ -23,5 +23,5 @@ index 8849d78fdfa..aff467f98fe 100644 void -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-armhf/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch similarity index 66% rename from cross/gcc-armhf/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch rename to cross/gcc-armhf/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch index fde874c35..452ced2ee 100644 --- a/cross/gcc-armhf/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch +++ b/cross/gcc-armhf/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch @@ -1,17 +1,18 @@ -From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001 +From 22d69ae3e2768d301ef5a1f1b362c25cf8bf27b9 Mon Sep 17 00:00:00 2001 From: Mathias LANG Date: Mon, 17 Jan 2022 03:49:21 +0000 -Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against - libucontext +Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext ref: alpine/aports#13422 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/Makefile.in b/Makefile.in +index 20f535a306a..c087bfe7cd4 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -54362,7 +54362,7 @@ configure-target-libphobos: +@@ -54382,7 +54382,7 @@ configure-target-libphobos: esac; \ module_srcdir=libphobos; \ rm -f no-such-file || : ; \ @@ -20,3 +21,6 @@ ref: alpine/aports#13422 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0031-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-armhf/0033-druntime-link-against-libucontext-on-all-platforms.patch similarity index 81% rename from cross/gcc-riscv64/0031-druntime-link-against-libucontext-on-all-platforms.patch rename to cross/gcc-armhf/0033-druntime-link-against-libucontext-on-all-platforms.patch index 72f9370ee..920cf677e 100644 --- a/cross/gcc-riscv64/0031-druntime-link-against-libucontext-on-all-platforms.patch +++ b/cross/gcc-armhf/0033-druntime-link-against-libucontext-on-all-platforms.patch @@ -1,7 +1,7 @@ -From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001 +From dc66835022cf68085400f2eed30614c5afdc28a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sat, 16 Jul 2022 09:21:11 +0200 -Subject: [PATCH 31/35] druntime: link against libucontext on all platforms +Subject: [PATCH] druntime: link against libucontext on all platforms On musl-based Linux distributions, swapcontext etc. are not provided by musl but instead by libucontext. Hence, we _always_ need to link against @@ -11,9 +11,11 @@ an external library for these functions. libphobos/m4/druntime/libraries.m4 | 8 -------- 2 files changed, 16 deletions(-) +diff --git a/libphobos/configure b/libphobos/configure +index 4f5be7d4ff4..0a48032edb4 100755 --- a/libphobos/configure +++ b/libphobos/configure -@@ -15375,14 +15375,6 @@ fi +@@ -15420,14 +15420,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 @@ -28,6 +30,8 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 $as_echo_n "checking for library containing swapcontext... " >&6; } +diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 +index 8dd9c7da107..b61bf528a14 100644 --- a/libphobos/m4/druntime/libraries.m4 +++ b/libphobos/m4/druntime/libraries.m4 @@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], @@ -45,3 +49,6 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then AC_SEARCH_LIBS([swapcontext], [c ucontext], [], AC_MSG_ERROR([swapcontext required but not found])) +-- +2.50.1 + diff --git a/cross/gcc-armhf/0033-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-armhf/0033-libphobos-do-not-use-LFS64-symbols.patch deleted file mode 100644 index 138bd64b7..000000000 --- a/cross/gcc-armhf/0033-libphobos-do-not-use-LFS64-symbols.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 29 May 2023 15:33:11 +0000 -Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols - -musl does not have these since 1.2.4, we can't use the compat interfaces. ---- - libphobos/libdruntime/core/sys/posix/config.d | 2 +- - libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- - 2 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d -index ae6752f220e..6b80d1ff0e6 100644 ---- a/libphobos/libdruntime/core/sys/posix/config.d -+++ b/libphobos/libdruntime/core/sys/posix/config.d -@@ -88,7 +88,7 @@ else version (CRuntime_Musl) - enum __REDIRECT = false; - - // Those three are irrelevant for Musl as it always uses 64 bits off_t -- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64; -+ enum __USE_FILE_OFFSET64 = false; - enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT; - enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT; - -diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d -index 0d3d517d69a..323aa0af72d 100644 ---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d -+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d -@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) - } - else version (CRuntime_Musl) - { -- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); -- static if (__USE_FILE_OFFSET64) -- alias mmap = mmap64; -- else -- void* mmap(void*, size_t, int, int, int, off_t); -+ void* mmap(void*, size_t, int, int, int, off_t); - int munmap(void*, size_t); - } - else version (CRuntime_UClibc) --- -2.41.0 - diff --git a/cross/gcc-riscv64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-armhf/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch similarity index 64% rename from cross/gcc-riscv64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch rename to cross/gcc-armhf/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch index b53e5847d..38354fa65 100644 --- a/cross/gcc-riscv64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +++ b/cross/gcc-armhf/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch @@ -1,15 +1,17 @@ -From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001 +From ab88348da140c68e5e1142041dbe1c7b7d9c9a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 19 Jul 2022 14:54:07 +0200 -Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc +Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc --- gcc/ada/libgnat/s-parame.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 98284a4d13e..0d14f116a10 100644 --- a/gcc/ada/libgnat/s-parame.ads +++ b/gcc/ada/libgnat/s-parame.ads -@@ -100,7 +100,7 @@ package System.Parameters is +@@ -101,7 +101,7 @@ package System.Parameters is -- Characteristics of time_t type -- ------------------------------------ @@ -18,3 +20,6 @@ Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc -- Number of bits in type time_t ---------------------------------------------- +-- +2.50.1 + diff --git a/cross/gcc-armhf/0035-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-armhf/0035-libphobos-do-not-use-LFS64-symbols.patch new file mode 100644 index 000000000..692f764f6 --- /dev/null +++ b/cross/gcc-armhf/0035-libphobos-do-not-use-LFS64-symbols.patch @@ -0,0 +1,30 @@ +From f865fb0a27252bd3a01fc4596f101d389929311c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 29 May 2023 15:33:11 +0000 +Subject: [PATCH] libphobos: do not use LFS64 symbols + +musl does not have these since 1.2.4, we can't use the compat interfaces. +--- + libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d +index b1eb9fa8107..3aee0d96319 100644 +--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d ++++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d +@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) + } + else version (CRuntime_Musl) + { +- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); +- static if (__USE_FILE_OFFSET64) +- alias mmap = mmap64; +- else +- void* mmap(void*, size_t, int, int, int, off_t); ++ void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); + } + else version (CRuntime_UClibc) +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0034-libgo-fix-lfs64-use.patch b/cross/gcc-armhf/0036-libgo-fix-lfs64-use.patch similarity index 98% rename from cross/gcc-aarch64/0034-libgo-fix-lfs64-use.patch rename to cross/gcc-armhf/0036-libgo-fix-lfs64-use.patch index cf47858d6..355edd642 100644 --- a/cross/gcc-aarch64/0034-libgo-fix-lfs64-use.patch +++ b/cross/gcc-armhf/0036-libgo-fix-lfs64-use.patch @@ -1,7 +1,7 @@ -From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001 +From cf6ba089ba26cd970962e874a3e35f020c3e921c Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 10 Jul 2023 23:23:29 +0000 -Subject: [PATCH 34/35] libgo: fix lfs64 use +Subject: [PATCH] libgo: fix lfs64 use --- .../go/internal/syscall/unix/at_largefile.go | 2 +- @@ -191,5 +191,5 @@ index 180f5c31d74..1d717d55c0e 100644 EREF(PRIO_USER); EREF(RUSAGE_SELF); -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0036-libphobos-add-riscv64-and-loongarch64-support.patch b/cross/gcc-armhf/0036-libphobos-add-riscv64-and-loongarch64-support.patch deleted file mode 100644 index ba8377b1d..000000000 --- a/cross/gcc-armhf/0036-libphobos-add-riscv64-and-loongarch64-support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Celeste -Date: Mon, 2 Sep 2024 02:54:17 +0000 -Subject: [PATCH] libphobos: add riscv64 and loongarch64 support - -Add musl support for these 2 architectures based on fenv.h and signal.h from: - -https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5 - -https://git.musl-libc.org/cgit/musl/tree/arch/loongarch64/bits?h=v1.2.5 ---- - libphobos/libdruntime/core/stdc/fenv.d | 13 +++++++++++++ - libphobos/libdruntime/core/sys/posix/signal.d | 10 ++++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d -index a7364c0a..5b327e4a 100644 ---- a/libphobos/libdruntime/core/stdc/fenv.d -+++ b/libphobos/libdruntime/core/stdc/fenv.d -@@ -436,20 +436,33 @@ else version (CRuntime_Musl) - ushort __cs_selector; - ushort __opcode; - uint __data_offset; - ushort __data_selector; - ushort __unused5; - version (X86_64) - uint __mxcsr; - } - alias ushort fexcept_t; - } -+ else version (RISCV64) -+ { -+ alias uint fenv_t; -+ alias uint fexcept_t; -+ } -+ else version (LoongArch64) -+ { -+ struct fenv_t -+ { -+ uint __cw; -+ } -+ alias uint fexcept_t; -+ } - else - { - static assert(false, "Architecture not supported."); - } - } - else version (CRuntime_Newlib) - { - version (AArch64) - { - alias fenv_t = ulong; -diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d -index a8b7f751..78d8b3cd 100644 ---- a/libphobos/libdruntime/core/sys/posix/signal.d -+++ b/libphobos/libdruntime/core/sys/posix/signal.d -@@ -2751,20 +2751,30 @@ else version (CRuntime_Musl) - else version (PPC_Any) - { - enum MINSIGSTKSZ = 4096; - enum SIGSTKSZ = 10240; - } - else version (X86_Any) - { - enum MINSIGSTKSZ = 2048; - enum SIGSTKSZ = 8192; - } -+ else version (RISCV64) -+ { -+ enum MINSIGSTKSZ = 2048; -+ enum SIGSTKSZ = 8192; -+ } -+ else version (LoongArch64) -+ { -+ enum MINSIGSTKSZ = 4096; -+ enum SIGSTKSZ = 16384; -+ } - else - static assert(0, "unimplemented"); - - //ucontext_t (defined in core.sys.posix.ucontext) - //mcontext_t (defined in core.sys.posix.ucontext) - - version (MIPS_Any) - { - struct stack_t - { diff --git a/cross/gcc-armhf/0035-loongarch-disable-multilib-support.patch b/cross/gcc-armhf/0037-loongarch-disable-multilib-support.patch similarity index 87% rename from cross/gcc-armhf/0035-loongarch-disable-multilib-support.patch rename to cross/gcc-armhf/0037-loongarch-disable-multilib-support.patch index acfc47c7f..da7e8b34d 100644 --- a/cross/gcc-armhf/0035-loongarch-disable-multilib-support.patch +++ b/cross/gcc-armhf/0037-loongarch-disable-multilib-support.patch @@ -1,15 +1,15 @@ -From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001 +From a809e7b909e16fcf3379571417d33574e9c1dbff Mon Sep 17 00:00:00 2001 From: Jingyun Hua Date: Mon, 7 Aug 2023 15:25:58 +0800 Subject: [PATCH] loongarch disable multilib support Signed-off-by: Jingyun Hua --- - gcc/config/loongarch/t-linux | 11 +++-------- + gcc/config/loongarch/t-linux | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux -index 23e1fb979..c2753abb8 100644 +index 45862048abf..73155acd832 100644 --- a/gcc/config/loongarch/t-linux +++ b/gcc/config/loongarch/t-linux @@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) @@ -28,5 +28,5 @@ index 23e1fb979..c2753abb8 100644 + MULTILIB_OSDIRNAMES += mabi.lp64f=../lib + MULTILIB_OSDIRNAMES += mabi.lp64s=../lib -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0037-static-pie.patch b/cross/gcc-armhf/0038-static-PIE-ensure-static-reaches-the-linker.patch similarity index 72% rename from cross/gcc-armv7/0037-static-pie.patch rename to cross/gcc-armhf/0038-static-PIE-ensure-static-reaches-the-linker.patch index a31c20e7e..bd870a370 100644 --- a/cross/gcc-armv7/0037-static-pie.patch +++ b/cross/gcc-armhf/0038-static-PIE-ensure-static-reaches-the-linker.patch @@ -1,17 +1,26 @@ -Patch-Source: https://github.com/richfelker/musl-cross-make/blob/6f3701d08137496d5aac479e3a3977b5ae993c1f/patches/gcc-14.2.0/0004-static-pie.diff +From 72606254a2456763cb252b4d729a9505e77e449d Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Fri, 25 Jul 2025 02:41:46 -0700 +Subject: [PATCH] static PIE: ensure -static reaches the linker -gcc doesn't enable static-pie for all arches. As of this writing arm -32-bit is missing. musl supports static-pie on all arches so this -should be allowed on all arches. +on some targets, the logic for the compiler option -static seems not +to be processed when -pie is present. rather than playing +whack-a-mole, just ensure LD_PIE_SPEC specs always pass -static to ld +if either -static or -static-pie is present on the compiler driver +command line. -Without this patch binaries with (only) -static-pie are broken on some -arches. +this may produce redundant -static arguments but it doesn't matter. +--- + gcc/common.opt | 4 ++-- + gcc/config/gnu-user.h | 17 ++++++++--------- + gcc/gcc.cc | 6 +++--- + 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 +index e65a575d9f8..7ad38711f6e 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver +@@ -3968,11 +3968,11 @@ Driver no-pie Driver RejectNegative Negative(shared) @@ -26,7 +35,7 @@ index a75b44ee47e..7c564818b49 100644 static-pie Driver RejectNegative Negative(pie) diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 +index 0426efdb8c3..866c8bd77f2 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -70,12 +79,12 @@ index 5ebbf42a13d..bb907d8e89a 100644 +#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " #endif - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ + #if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) diff --git a/gcc/gcc.cc b/gcc/gcc.cc -index 3c81c5798d8..cd96eac5d12 100644 +index e9f78f0f4c1..767ff65f348 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ +@@ -1056,7 +1056,7 @@ proper position among the other output files. */ #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" #else @@ -84,12 +93,12 @@ index 3c81c5798d8..cd96eac5d12 100644 #define FPIE1_SPEC "fpie" #define NO_FPIE1_SPEC FPIE1_SPEC ":;" #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ +@@ -1080,12 +1080,12 @@ proper position among the other output files. */ #ifndef LINK_PIE_SPEC #ifdef HAVE_LD_PIE #ifndef LD_PIE_SPEC -#define LD_PIE_SPEC "-pie" -+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic %{static-pie:-static}}" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic -static}" #endif #else #define LD_PIE_SPEC "" @@ -99,3 +108,6 @@ index 3c81c5798d8..cd96eac5d12 100644 #endif #ifndef LINK_BUILDID_SPEC +-- +2.50.1 + diff --git a/cross/gcc-armv7/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-armhf/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch similarity index 97% rename from cross/gcc-armv7/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch rename to cross/gcc-armhf/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch index b55477e53..c713030bb 100644 --- a/cross/gcc-armv7/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +++ b/cross/gcc-armhf/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch @@ -1,4 +1,4 @@ -From 49926c2c657dd867f7329df6e250913fd1425475 Mon Sep 17 00:00:00 2001 +From d984c5c9ed973bb7072b48399e5d9bb1f35c3123 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 28 Mar 2025 17:25:56 -0700 Subject: [PATCH] except: Don't use the cached value of the gcc_except_table @@ -73,5 +73,5 @@ index 00000000000..50afa75a43f +// There should be 3 exception tables, +// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } -- -2.49.0 +2.50.1 diff --git a/cross/gcc-armhf/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch b/cross/gcc-armhf/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch new file mode 100644 index 000000000..a25266014 --- /dev/null +++ b/cross/gcc-armhf/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch @@ -0,0 +1,164 @@ +From 57eb290b3c8fc36da99213f5050b46cd93575234 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Sat, 26 Jul 2025 02:59:45 -0700 +Subject: [PATCH] ada: libgnat: use stub symbolic module name functions + +The "linux" implementation depends on glibc internals and accordingly +does not work on musl. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/Makefile.rtl | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index cb41e6887cd..152ba70db4d 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1642,7 +1642,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb +Date: Sat, 26 Jul 2025 03:02:38 -0700 +Subject: [PATCH] ada: libgnat: recognize linux-musleabi and linux-muslgnueabi + platforms for ARM + +--- + gcc/ada/Makefile.rtl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 152ba70db4d..89574cdfba7 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2500,7 +2500,7 @@ endif + + # ARM linux, GNU eabi + ifeq ($(SELECTED_PAIRS),PAIRS_NONE) +-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),) ++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),) + + SELECTED_PAIRS=arm-linux-gnueabi + +-- +2.50.1 + diff --git a/cross/gcc-armhf/APKBUILD b/cross/gcc-armhf/APKBUILD index 7a6500c82..3dcd0b4cb 100644 --- a/cross/gcc-armhf/APKBUILD +++ b/cross/gcc-armhf/APKBUILD @@ -24,7 +24,7 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-armhf -pkgver=14.3.0 +pkgver=15.1.1_git20250719 # i.e. 13.2.1, must match gcc/BASE-VER _pkgbase="${pkgver%%_git*}" # date component from snapshots @@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-armhf -pkgrel=6 +pkgrel=2 pkgdesc="Stage2 cross-compiler for armhf" url="https://gcc.gnu.org" arch="x86_64" @@ -183,7 +183,7 @@ if $_libgomp; then fi case "$CTARGET_ARCH" in -riscv64|loongarch64) +riscv64) LANG_ADA=false;; esac @@ -241,7 +241,7 @@ fi # PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches, # so that they can be properly tracked and easily rebased if needed. #source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz -source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz +source="https://gcc.gnu.org/pub/gcc/snapshots/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-specs-turn-on-Wl-z-now-by-default.patch @@ -249,37 +249,40 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch 0006-Enable-Wformat-and-Wformat-security-by-default.patch 0007-Enable-Wtrampolines-by-default.patch - 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch - 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch - 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch - 0011-libiberty-copy-PIC-objects-during-build-process.patch - 0012-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-libphobos-do-not-use-LFS64-symbols.patch - 0034-libgo-fix-lfs64-use.patch - 0035-loongarch-disable-multilib-support.patch - 0036-libphobos-add-riscv64-and-loongarch64-support.patch - 0037-static-pie.patch - 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch + 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch + 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0012-libiberty-copy-PIC-objects-during-build-process.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-ada-fix-shared-linking.patch + 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0017-add-fortify-headers-paths.patch + 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0020-aarch64-disable-multilib-support.patch + 0021-s390x-disable-multilib-support.patch + 0022-ppc64-le-disable-multilib-support.patch + 0023-x86_64-disable-multilib-support.patch + 0024-riscv-disable-multilib-support.patch + 0025-always-build-libgcc_eh.a.patch + 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch + 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch + 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch + 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch + 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch + 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch + 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch + 0033-druntime-link-against-libucontext-on-all-platforms.patch + 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch + 0035-libphobos-do-not-use-LFS64-symbols.patch + 0036-libgo-fix-lfs64-use.patch + 0037-loongarch-disable-multilib-support.patch + 0038-static-PIE-ensure-static-reaches-the-linker.patch + 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch + 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " # secfixes: @@ -287,8 +290,8 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz # - CVE-2023-4039 # we build out-of-tree -#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap -builddir="$srcdir"/gcc-$_pkgbase +builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap +#builddir="$srcdir"/gcc-$_pkgbase _gcclibdir="usr/lib/gcc/$CTARGET/$_pkgbase" _gcclibexec="usr/libexec/gcc/$CTARGET/$_pkgbase" @@ -752,43 +755,46 @@ gdb() { } sha512sums=" -cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93 gcc-14.3.0.tar.xz -1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch -6dd1eecbc050e30e5a0493969a0e80507d971f4ca87c06466f725fa50c9106e18aef86453fc8a80cd277438b6e79695a99cdaf2eaeb2f1add7e28f7cffd0cd2f 0002-gcc-poison-system-directories.patch -b6903b60b01187bfebc961e74d01ff5d8dc2852747663dff2b4a4f66df4b5aa412347fe92926cce1821fdd0c59d088404acbbced4b464aba9664d599a9e1bbce 0003-specs-turn-on-Wl-z-now-by-default.patch -d41a519ea5014e9ab49f017d3793e2a0a82429c2b7ded2776f2df7a2d0ac02aa294e7dbe74e027fe7c844c87525d483e0eda3846cf16340eb02e934389cfd838 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e34d7bb51c4c413b1a10bafcdfd5729fb5980b0288277ef44ed4779700d443d2fd22129b3b22d401def140851263e803160d2f3ed8825b0bf4f3fb8606db77bd 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -83665b6adb0b8080245b253abe3344ee5106ac2bc248aad9bef713b22b644a268d75c75fbab7554e0543836903a89bc4f0bec4b6d6d4e3d5ba355dddbc5ba190 0006-Enable-Wformat-and-Wformat-security-by-default.patch -ca5757a32f02bb24bc5b42bb03dca49fb9f9e6f34776343f1c5580efd2bcacf8c5b59f4b61652fa3ea1506eb14bcd390f5fda7b4cbfd32f7d1a750d14add4739 0007-Enable-Wtrampolines-by-default.patch -e476da4c2f29a941b7f4f1dfc9a37ba82b439badc47fc3fb72630ec5620f64849bdb66d339e0182674a0ee898a75564ffaf702986b770bfd793e7fbdcaa9f21b 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch -b40b6cbc3725ae88c506bc39a8ba10cfcdcc208fa26d667393bbb80e24346da2ccfac3ff914bb9fc4c374f022fa7f913e6873b9a66a96b79a1ac84959c9d5348 0012-libgcc_s.patch -6cc2c00b15d259289fa9831b60b58f8afdf09858410bd08ab3d839a45c6f3fb9e8e214dab851d105c61df7965f1c10255c84b5b6301630a390b27b8929a25e1e 0013-nopie.patch -0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch -7640e71cd957066e2e07ffcec1f8540cd6b1bdaf976c980693bf6f5d3afaf51ca7e41c62f92cb13c86c2dea9eb9cd799b2e3ea77d74926e82bf1e12bb7a4d64e 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch -8a8c9dc96f300f660f1a643c800352383f32db258dfcfa88a44159a38bb81a7298089a5dcb23906002c85cafc806caf6f3db0e1cb26fcac6192ae1e41d9ada3a 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -6c1cbfcf9e6f54b2173af39bbbfd97e7c18ae32a690fb4c6b1e35fa183992ea0f8046d479be57b6ac7d798bf2a6dade4f9ea3e3a839dc6fb8d47203de9c89e25 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch -a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch -f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch -44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch -0ef65a344975b641343767e289578ba5b0fd381c7177ebe4558cb67d8b41e33e3b825478fa46852f1f40ec9119ff908cf75ee36307266aea13f39460e080b0b6 0023-riscv-disable-multilib-support.patch -55438233a217dc1ee58990413b8782b9bd560a1532c1e6c860f377072ed1bdf75d5dc2458ed33194040ec5427c30df3fa68948dcd26de90e3803d3f7b784becd 0024-always-build-libgcc_eh.a.patch -8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch -02e8358b8855fb49bbb2b3ef293cff67441c5fdf1f2fee4dcec86ef1fd4f701e899ea9c7e072d888b0f1e674d7874d3085138f3deb9845d1f2e35d4a1fe3f5ab 0026-ada-musl-support-fixes.patch -8eff7679140f9e39f1a0ac2e4a6cc7e131efa3d5a669696dd28300eb5d75ef3be62f10c1b91d8f8c8ba2cba1ff9cf121228b6fcd3adafa28389ac63698e7d5a7 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch -720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch -2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch -458c9b121e00cec4d0dbe1d18c5e5332342eb0a3429129e5a9d9ace3247c31d85571ad9f47046c4ed3bc62e5d8a4297f48744a30424a19acbdd9aa484e3ee715 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch -099103f4b0b4612ff4bd2e8721cf1593415b636bff74d4feba304bb610ced6f4951cb3ab89088111e58029a2f9bf4a5dcc91e2b2afe4dd9813d2fa6b0999a5a2 0031-druntime-link-against-libucontext-on-all-platforms.patch -21ff4d55eec48ad4a9db0cd359e760cff548f7f6b1a67759a2e87fc7e16a262d82d2f980d309a3ce5e14097665beeb5516a5f2d98869a5d28345e685c6fe689d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch -c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch -c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch -65df1d489e8d07a811f39e27fd29e3b2b4164fbc2c5fdc16a5142886d94a96e3fb28ccf4f20dd297ba6540ef8ea1ac3eb65a4279494639bf2f0f8376a3896cc3 0035-loongarch-disable-multilib-support.patch -06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch -8249ce989c1a76bcb5bbb1123ef88d88f220b709fe6ac804f18c905a7b31c4e68ef6f5cc2236f446feed89fa773a3aed996a6aba7618e73a000d73cb0b0753f6 0037-static-pie.patch -90b6148d47f39caf1b70416abf2a09f4ce048491f784f56bd659dbf99e2c9f6a44b244827f23977494ab4e42640c49c1dc79f43a4d69c2b31c4b1e25d54d8142 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +a5e0082e492502385565479201bca3e9f5138a55d83540bff8b84a94d958c4d2afce474328656ee7d55fad910c04523c0068efe92382e68a327a65f6e641b88a gcc-15-20250719.tar.xz +fd5cebc5deb1d588583424acbc1b5a6d8d6f5b1bfa9f4bdbc082cfd406723f423d87011ee30e04ed18128a7ed8021cbfc9262becff5419125dc1afb6f407defa 0001-posix_memalign.patch +6634004cb9feea9ee0d063d6b6984d7db3b10c692b6139bb99169a4f2d74f0e10b5ca0ab31ce346ffef34b8eb9c3f536aa4d94bce1b27f8e0b8a9fc5cc4b7057 0002-gcc-poison-system-directories.patch +37e089791dbcbad73af866b662cda611dc0970d93e28251c7a9aa898db3b96446654e8b778d7866eb8550ba7f4a57cf22e8514d562bfed0c66613e65550d9c85 0003-specs-turn-on-Wl-z-now-by-default.patch +d4d5bfeb20a9fac968f37497d86d7eff4a9ac863e015dadbffae24c08236f5efde69b615d95191e2546672ce2d4b30d3627528c64a83fc64b715e8fa6fd4c372 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +b77cd1ee887fc52afee2fafd2d338f70a62c115017aa4fcb0ab9cf82b8a003794f75b7913cc153c767c351d2be8e1e7c113f893edee818217f20cad3cb6a2e66 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +af634de360e8b7aef285702815affb16da667719b786848ccdb9e4cca2a27826793f64c903a32a5d8ba1953965a5cc8999c58e2b6ce9ef36f74807e495cc9e42 0006-Enable-Wformat-and-Wformat-security-by-default.patch +21ad1cd4b7ef652ddaf6b9fb8071a87ec2fc694e8c420a79baf456347b8e1db5930a914c92a375943dda63d096c4823a2b8028d02a5b49c9bcdab5c170558004 0007-Enable-Wtrampolines-by-default.patch +dcd07ecf0daad8743a378abbcb921d4b17e528651a596454956563a3417fe9ea3b88dce7b15b9270f55ae2ea2a72efe8a7215236d0a21e2942c7c5ba0e8e2c39 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch +488bd530e209e3213f83d695fb2ac529c408e3dba9024457594cfb0d266acb079447bca184fbf136bacd1f1ec5ca3607dc4998b66630af9781ea7ee41c16236b 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch +7229a3fe655e8460148e0cd4c39d7362e713d1a6215530547f346371a5e3647245123637e8b075c58c5e7e35c823d96a0b3cdbedb6c07b5095507b4499bc053a 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +f7c1870bda4d418380f471b520b7cf20fde743f57415323c1a8898a815f8c7023adc3882e1d0453c5b6fcb65a27a9534fdeb297bf451453a95d90c0395e42c3b 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch +140c8165726404da0fc0ea01add2a7fa307377817968177334c520bdaabc23e8ec5d76f80337b89ff03edfd52dead7119433a03d2165e24780dc944633a9c2a3 0012-libiberty-copy-PIC-objects-during-build-process.patch +af848ef58b63a7592ad0f549be65fbe8dcd3c1e5ea9f30cfa65be02519ca9826d7612131c3b0042615b7537683d74eeb6849aba61810b0d8ed1c79f968188260 0013-libgcc_s.patch +c97b473c08b46090b48764af55b244ec70a13d26f2d881c57761abbc4a1c481da9766f33e59daee7188bc06c4631e53becbaf8801d0b35ca0b5fe84cb6a840f7 0014-nopie.patch +9c37cc38bb7238058751d3ff60712acd4134aa4c28d946c453b8b230bd6ba34c45c47a4b4d7e74aa7e3ed8dfc74cbb1d5a328bda706dd3037320e02a15421b86 0015-ada-fix-shared-linking.patch +b4afb30431ecdfd86acfd66ba857c275628b55e91cc9b21c18ca0e795b2fadfe895da801978a8e818ff9c93144075e72cf0521f3bce5c6c1d44e47e1b77b8ba4 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +6260341ed13926ce449cf351ada85d8e28fc7da63a4ae73b69c24fb2e8d0e3003ffacb1bb0f957185b8d5d7e013f777f7f696c9a1c94b2204a9b3e8274ec2f43 0017-add-fortify-headers-paths.patch +8fe954daf7e9b1d221f0536f54186bc1715e23cf3c74dfd0956c0fa22ce3b5b5e30b5e17ea584db1cc193ac7fdc72daff68c9163dbc46a837e01d25a7a4a90e0 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +fc5ce12cd70382b15317931ff0f57ae1ed10e8c09dbf2fee627bc55a268f55ebbf9ae32b89b4ef6f51e9a9b7ca32eed201245d481cde88f6eb572d40134f5f4c 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +e0d4fd0e0bf4ecfb517b60b55d73f326deda0faa75bfd07d1fcae116f91088a96caaa2dd20e2e38a93cc8ffed0aef422c0c861879c8de406364faef0cbcd50ff 0020-aarch64-disable-multilib-support.patch +7af318ea6fe14dce98b8db1f8f46a2dc9f75c2f27e63a52c62c7b47d6d62cb64748d5c2690eba772d931ff96ac089e3f03bf46b49122ffb5a03a1c186f01ae11 0021-s390x-disable-multilib-support.patch +b96dbbd0e1aa98ebc2e7eaa2a44912681e4c8bc9a129fafa53a943d67b62451b6d4fad53f92429cd4346a753527359c8c09d58836cf0968a56f5fe933496a412 0022-ppc64-le-disable-multilib-support.patch +60106cb08f27c89509ba46dc2ff0edecc1f4c7973874c85047dfdd67eabe50e3a852d7540002a09bcb6185c786a5daeba7915958c441fc92d7f16a0cce5bcdea 0023-x86_64-disable-multilib-support.patch +d55d65242af9341eef7f1e3d03fec2e2de75632a23ed83df4fe6304619f62127b42eba9d9286f7f3647e3b9bd95aaeb79023263e71ff9d58c47f3051b73d8bc2 0024-riscv-disable-multilib-support.patch +b6dda179cafbd9e7f3ef7e137b303a76491a0157d68f1504dee6611cecdca16d27ca32cbd2298da2f6301e7167b8730d70a775ee5ba88ae3773adef8421efa98 0025-always-build-libgcc_eh.a.patch +95245b6548ddca5065bac06131294028767a32740c80f707a4d1cf8653a0398305ec68e7c44a3f2912741b792d41048f03729657b0a1c1a2a7bff097c6b2fdc7 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch +ff6b8b9e1ab9b45d1853e74befb5c904cf7cd83dadb5a4b6f8c94a75e6249d1cdaa72aef73d6b1045beabc2d9012ea869d886015ec3aae561eb4ba8b9d00c2d7 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch +0582f00e8801df06e51fca45a8dc3ee62e9b6ce9245af98937f435c90c709edc7eb9071569c0e59c9a143d964fe5731b9e11b011174443b97043abddc9db1cce 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch +8683314212c0a6f49ed45ea8c74908f59d863822fa8c99e94c7e39ba3a642ca6a3167543e1ae4b58d8acd1ff97824d6e60cc432b19e6580cad2027e3a5c37603 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +60bb67f6cf4b92243dec861fba702aa5847925bf413c2c83705a0ee4ebe4c523cc295cce29666c69c9b2dec70d63def83cd9074e613b4f46e014248f53c87db4 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch +b49f72cce409f74407761fe64b028e97d58e4f236af7d9099189a8553f2ece3f30559760fab768f3d1fc4c7f89ae3ee6d687018251f3df52c9a43817c9c7c93e 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +0bd3aa81590d5f47205e193d2998bb5986cbb82adb75e3d39dcf820625bb358d380d1695ebbb18437fdd935ce350b0f5b7364a5fa7c8e07ebe8f972c8cd46cd1 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch +e8d5c4159f41fcb09e76758768d127ff366c93095137b694a405e9dbba88f2036ba64b69ac6c5c75e488be3281a1227cccbadcea2bef6f60ba0be7fc3d7db754 0033-druntime-link-against-libucontext-on-all-platforms.patch +6f530cdb1935296925ec29be7a30e4d69cebc155695db6ea30ee95ce65de7e8917e2a6148d3668974715120e7f13f734e5c36bfd35f707f4725a7556cbc1caa5 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +1dabb0c8d581ec86d8758dfa3d2f1713d915f6d927639f56b3590ed9b0885dfdf452e30ca87edac49721d2dc43d4fbdb4d178f8448e8ba5cc595457f216bf210 0035-libphobos-do-not-use-LFS64-symbols.patch +b915a0eaf7cc3e48f41f31ebbd9142760891b9ede304ff3f1dc7166f85a9e3f82017a17bb7e65824d3da07445b2c8bcd156a992eed92633362c08329b04b6cb4 0036-libgo-fix-lfs64-use.patch +0164467e66719187b6041c8d2d717a9bcd5b8c801dab6391b0e503c41e26518cc78389c97bdd2b2bc64f660f95410439aaa8a20799ec01eab17e7ba415ac1dd9 0037-loongarch-disable-multilib-support.patch +2cae2cb470b2cf469973c0ff3a7a020960cf4325502ff6c84c6b1b3514c8cacfae8452b5c79b55e657b0877fc9d81cc68db6f650156ca6d1376c1bd1a2290d8b 0038-static-PIE-ensure-static-reaches-the-linker.patch +7d73041566678fc86885877d8315481bf358858cbe54227356d5ab48623e435426ac7ff6e54d21b9fee4cc73e3f4bc7ef646d3e4ab1970e524c890cd1f735905 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +4556ead97907ec76aaa7dde450e4b6068f87268c49168eeb2af0c3df1dfa312b0a4a947b65b11fd413dae9af0beb3ef002d077c0d7f43b0bc466d3cd4348e657 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch +389eacbeba976a461af3d087d732d1c4f2a38bc5db91b935149e60ad4b210286ba76688b8a947d00f324566b6789152bf3b93a188fa2fb7ee8042786df483fed 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " diff --git a/cross/gcc-armv7/0001-posix_memalign.patch b/cross/gcc-armv7/0001-posix_memalign.patch index 04240c29c..bbc2db9ca 100644 --- a/cross/gcc-armv7/0001-posix_memalign.patch +++ b/cross/gcc-armv7/0001-posix_memalign.patch @@ -1,14 +1,14 @@ -From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001 +From 94cf7d2b3514ed3a4401861a519ead450e022afc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/35] posix_memalign +Subject: [PATCH] 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 3527283693b..c4071b64b53 100644 +index d1d79a32fc9..069c3bb8324 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ @@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644 else return NULL; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0002-gcc-poison-system-directories.patch b/cross/gcc-armv7/0002-gcc-poison-system-directories.patch index 9a1671267..de66b72d0 100644 --- a/cross/gcc-armv7/0002-gcc-poison-system-directories.patch +++ b/cross/gcc-armv7/0002-gcc-poison-system-directories.patch @@ -1,7 +1,7 @@ -From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001 +From 0d5e04099a3d2609105719f7396a4ff941b873b6 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/35] gcc: poison-system-directories +Date: Thu, 23 Jan 2025 17:12:51 -0800 +Subject: [PATCH] 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 @@ -11,23 +11,25 @@ aborted. Instead, we add the two missing items to the current scan. If the user wants this to be a failure, they can add "-Werror=poison-system-directories". +Upstream-Status: Inappropriate [OE configuration] Signed-off-by: Mark Hatle +Signed-off-by: sunil dora Signed-off-by: Khem Raj - -Upstream-Status: Pending --- gcc/common.opt | 4 ++++ - gcc/config.in | 6 ++++++ - gcc/configure | 16 ++++++++++++++++ - gcc/configure.ac | 10 ++++++++++ + gcc/config.in | 10 ++++++++++ + gcc/configure | 19 +++++++++++++++++++ + gcc/configure.ac | 16 ++++++++++++++++ gcc/doc/invoke.texi | 9 +++++++++ - gcc/gcc.cc | 2 ++ - gcc/incpath.cc | 21 +++++++++++++++++++++ - 7 files changed, 68 insertions(+) + gcc/gcc.cc | 12 ++++++++++-- + gcc/incpath.cc | 25 +++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 2 deletions(-) +diff --git a/gcc/common.opt b/gcc/common.opt +index e3fa0dacec4..bea1adc0940 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -715,6 +715,10 @@ Wreturn-local-addr +@@ -729,6 +729,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. @@ -38,9 +40,11 @@ Upstream-Status: Pending Wshadow 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 a79c51adb2b..8a531ed591c 100644 --- a/gcc/config.in +++ b/gcc/config.in -@@ -249,6 +249,12 @@ +@@ -249,6 +249,16 @@ #endif @@ -48,14 +52,20 @@ Upstream-Status: Pending +#ifndef USED_FOR_TARGET +#undef ENABLE_POISON_SYSTEM_DIRECTORIES +#endif ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef POISON_BY_DEFAULT ++#endif + + /* Define if you want all operations on RTL (the basic data structure of the 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 16965953f05..0f4a5d52c30 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1050,6 +1050,7 @@ enable_maintainer_mode +@@ -1051,6 +1051,7 @@ enable_maintainer_mode enable_link_mutex enable_link_serialization enable_version_specific_runtime_libs @@ -63,7 +73,7 @@ Upstream-Status: Pending enable_plugin enable_host_shared enable_host_pie -@@ -1823,6 +1824,8 @@ Optional Features: +@@ -1828,6 +1829,8 @@ Optional Features: --enable-version-specific-runtime-libs specify that runtime libraries should be installed in a compiler-specific directory @@ -72,7 +82,7 @@ Upstream-Status: Pending --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE -@@ -34082,6 +34085,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -83,47 +93,60 @@ Upstream-Status: Pending + enable_poison_system_directories=no +fi + -+if test "x${enable_poison_system_directories}" = "xyes"; then ++if test "x${enable_poison_system_directories}" != "xno"; then + +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++if test "$enable_poison_system_directories" = "error"; then ++$as_echo "#define POISON_BY_DEFAULT 1" >>confdefs.h ++fi + +fi + # Substitute configuration variables +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 9f67e62950a..b0e3615e5aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7555,6 +7555,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) +AC_ARG_ENABLE([poison-system-directories], + AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system header directories]),, ++ [warn for use of native system header directories (no/yes/error)]),, + [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then ++AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories]) ++if test "x${enable_poison_system_directories}" != "xno"; then ++ AC_MSG_NOTICE([poisoned directories enabled]) + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], + [1], + [Define to warn for use of native system header directories]) ++ if test $enable_poison_system_directories = "error"; then ++ AC_MSG_NOTICE([poisoned directories are fatal]) ++ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors]) ++ fi +fi + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 72009c33cd0..29aea724731 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -405,6 +405,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 -@@ -8861,6 +8862,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. + -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor + -Wno-psabi + -Wredundant-decls -Wrestrict +@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default. + Suppress warnings from casts from a pointer to an integer type of a + different size. +@opindex Wno-poison-system-directories +@item -Wno-poison-system-directories @@ -133,12 +156,27 @@ Upstream-Status: Pending +directories contain the correct headers and libraries for the target +system rather than the host. + - @opindex Wfloat-equal - @opindex Wno-float-equal - @item -Wfloat-equal + @opindex Winvalid-pch + @opindex Wno-invalid-pch + @item -Winvalid-pch +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 4fd87f2c4a1..79d4920a047 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1163,6 +1163,8 @@ proper position among the other output files. */ +@@ -909,6 +909,12 @@ proper position among the other output files. */ + #define ASM_MAP "" + #endif + ++#ifdef POISON_BY_DEFAULT ++#define POISON_IS_ERROR " -Werror=poison-system-directories" ++#else ++#define POISON_IS_ERROR ++#endif ++ + /* Assembler options for compressed debug sections. */ + #if HAVE_LD_COMPRESS_DEBUG == 0 + /* Reject if the linker cannot write compressed debug sections. */ +@@ -1166,6 +1172,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}}} \ @@ -147,6 +185,26 @@ Upstream-Status: Pending %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +@@ -1268,7 +1276,7 @@ static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ + %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR; + + /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. + +@@ -1297,7 +1305,7 @@ static const char *cc1_options = + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +- %{pthread:-fprofile-update=prefer-atomic}}}"; ++ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR; + + static const char *asm_options = + "%{-target-help:%:print-asm-header()} " +diff --git a/gcc/incpath.cc b/gcc/incpath.cc +index c1bbfd3872a..2cdbebc4c50 100644 --- a/gcc/incpath.cc +++ b/gcc/incpath.cc @@ -26,6 +26,7 @@ @@ -157,9 +215,20 @@ Upstream-Status: Pending /* Microsoft Windows does not natively support inodes. VMS has non-numeric inodes. */ -@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) +@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + cur->name, xstrerror (errno)); + reason = REASON_NOENT; + } ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ pcur = &cur->next; ++ continue; ++#endif + } + else if (!S_ISDIR (st.st_mode)) + cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0, +@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + fprintf (stderr, _("End of #embed search list.\n")); } - fprintf (stderr, _("End of search list.\n")); } + +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES @@ -168,19 +237,22 @@ Upstream-Status: Pending + struct cpp_dir *p; + + for (p = heads[INC_QUOTE]; p; p = p->next) -+ { -+ if ((!strncmp (p->name, "/usr/include", 12)) -+ || (!strncmp (p->name, "/usr/local/include", 18)) -+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) -+ || (!strncmp (p->name, "/sw/include", 11)) -+ || (!strncmp (p->name, "/opt/include", 12))) -+ warning (OPT_Wpoison_system_directories, -+ "include location \"%s\" is unsafe for " -+ "cross-compilation", -+ p->name); -+ } ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } + } +#endif } /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.50.1 + diff --git a/cross/gcc-armv7/0003-specs-turn-on-Wl-z-now-by-default.patch b/cross/gcc-armv7/0003-specs-turn-on-Wl-z-now-by-default.patch index 33e8b56f1..be6a3dc60 100644 --- a/cross/gcc-armv7/0003-specs-turn-on-Wl-z-now-by-default.patch +++ b/cross/gcc-armv7/0003-specs-turn-on-Wl-z-now-by-default.patch @@ -1,7 +1,7 @@ -From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001 +From 90e8697dd88fd99ce2cf8739e95494853005377e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default +Subject: [PATCH] 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. @@ -13,9 +13,11 @@ now by default. gcc/gcc.cc | 1 + 2 files changed, 4 insertions(+) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 29aea724731..6fb3ab70cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -18935,6 +18935,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -19477,6 +19477,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}. @@ -25,9 +27,11 @@ now by default. @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 79d4920a047..74a356fdf5e 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1161,6 +1161,7 @@ proper position among the other output files. */ +@@ -1170,6 +1170,7 @@ proper position among the other output files. */ "%{flto|flto=*:% Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, - ObjC, ObjC++, if the optimization level is > 0 +Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, + ObjC++, if the optimization level is > 0 --- gcc/c-family/c-cppbuiltin.cc | 4 ++++ gcc/doc/invoke.texi | 6 ++++++ 2 files changed, 10 insertions(+) +diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc +index 4589ee4a3a6..9edf095384c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc -@@ -1570,6 +1570,10 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -1581,6 +1581,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); @@ -22,9 +24,11 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, /* Misc. */ if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 6fb3ab70cc7..799ce073dbf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -12496,6 +12496,12 @@ also turns on the following optimization flags: +@@ -12840,6 +12840,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. @@ -37,3 +41,6 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, @opindex O3 @item -O3 Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.50.1 + diff --git a/cross/gcc-armv7/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/cross/gcc-armv7/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 819ef5e76..deb4da3dc 100644 --- a/cross/gcc-armv7/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/cross/gcc-armv7/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,8 +1,8 @@ -From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001 +From a59da582e83071de0566274d912ca6f05f4b75d0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the - linker, but always link the sanitizer libraries with --no-as-needed. +Subject: [PATCH] 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 + @@ -21,9 +21,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the gcc/gcc.cc | 28 ++++++++++++++++++++-------- 14 files changed, 36 insertions(+), 19 deletions(-) +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index 116bb4e69f3..daf99f8dce9 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h -@@ -35,6 +35,7 @@ +@@ -39,6 +39,7 @@ #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ @@ -31,6 +33,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 3fd3b831166..0b4c2dccebe 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 @@ -42,6 +46,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{O*:-O3} %{!O*:-O1} \ %{shared:-shared} \ %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index d4d389e2aa8..adccc0b11c2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -52,6 +58,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 4c4e31efa39..3c17ac6eade 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 @@ -78,6 +86,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the #endif #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index 7abfda53049..ceb8f855b7d 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 @@ -89,6 +99,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index abe714711bf..3ca128a79f5 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 @@ -99,6 +111,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index a2494c214c4..e1a5d530cdf 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -110,6 +124,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5a82508c113..6eee7cdc603 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 @@ -120,6 +136,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 9060c940a44..282c77b6a7b 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see @@ -130,6 +148,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ -X \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 0316d8cb65d..139e1b6796c 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -378,13 +378,13 @@ extern int dot_symbols; @@ -148,6 +168,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!static-pie: \ %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ +diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h +index afb5c6ad867..b64638fb25b 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -159,6 +181,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 2c3bca5dfcb..b90661247a4 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 @@ -170,6 +194,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 6d928846895..3cc05bb7240 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); @@ -181,9 +207,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!static: \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 74a356fdf5e..fc9c7d15b04 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -771,8 +771,11 @@ proper position among the other output files. */ +@@ -774,8 +774,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -197,7 +225,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -807,8 +810,11 @@ proper position among the other output files. */ +@@ -810,8 +813,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -211,7 +239,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -825,8 +831,11 @@ proper position among the other output files. */ +@@ -828,8 +834,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +253,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -841,8 +850,11 @@ proper position among the other output files. */ +@@ -844,8 +853,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 @@ -239,3 +267,6 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-armv7/0006-Enable-Wformat-and-Wformat-security-by-default.patch b/cross/gcc-armv7/0006-Enable-Wformat-and-Wformat-security-by-default.patch index b4d580f85..b8851777b 100644 --- a/cross/gcc-armv7/0006-Enable-Wformat-and-Wformat-security-by-default.patch +++ b/cross/gcc-armv7/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -1,15 +1,17 @@ -From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001 +From 35c02ea8267e193b92f30495c94ee1e8e5c2be8e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH] 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 75b6531860e..78830ce4b42 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -774,7 +774,7 @@ Warn about function calls with format strings that write past the end +@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end of the destination region. Wformat-security @@ -18,7 +20,7 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -799,7 +799,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -27,3 +29,6 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about printf/scanf/strftime/strfmon format string anomalies. Wframe-address +-- +2.50.1 + diff --git a/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch index 140685d7b..eda9ab096 100644 --- a/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch @@ -1,16 +1,18 @@ -From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/35] Enable -Wtrampolines by default. +From 0b82663fd2f054e07e116c4dcc5019f7e969cd3e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:44:20 -0700 +Subject: [PATCH] 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 bea1adc0940..e65a575d9f8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -811,7 +811,7 @@ Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers. +@@ -829,7 +829,7 @@ Common Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wa + Warn if a comparison always evaluates to true or false. Wtrampolines -Common Var(warn_trampolines) Warning @@ -18,3 +20,6 @@ Subject: [PATCH 07/35] Enable -Wtrampolines by default. Warn whenever a trampoline is generated. Wtrivial-auto-var-init +-- +2.50.1 + diff --git a/cross/gcc-armv7/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/cross/gcc-armv7/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch deleted file mode 100644 index e85284ff0..000000000 --- a/cross/gcc-armv7/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and - -ffreestanding Change the buffer size. - ---- - gcc/gcc.cc | 8 +++++++- - gcc/params.opt | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1000,6 +1000,12 @@ proper position among the other output files. */ - #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" - #endif - -+#ifdef ENABLE_DEFAULT_SSP -+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " -+#else -+#define NO_SSP_SPEC "" -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1305,7 +1311,7 @@ static const char *cc1_options = - %{-version:--version}\ - %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ -- %{fsyntax-only:-o %j} %{-param*}\ -+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ - %{coverage:-fprofile-arcs -ftest-coverage}\ - %{fprofile-arcs|fcondition-coverage|fprofile-generate*|coverage:\ - %{!fprofile-update=single:\ ---- a/gcc/params.opt -+++ b/gcc/params.opt -@@ -1013,7 +1013,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim - The maximum number of SSA_NAME assignments to follow in determining a value. - - -param=ssp-buffer-size= --Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization -+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization - The lower bound for a buffer to be considered for stack smashing protection. - - -param=stack-clash-protection-guard-size= diff --git a/cross/gcc-armv7/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch b/cross/gcc-armv7/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch new file mode 100644 index 000000000..8997916ca --- /dev/null +++ b/cross/gcc-armv7/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch @@ -0,0 +1,39 @@ +From 3acf32fc94fd447874b2f1447a19a65f0905bff5 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:49:03 -0700 +Subject: [PATCH] gcc: disable SSP on -ffreestanding, -nostdlib and + -nodefaultlibs + +--- + gcc/gcc.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9c7d15b04..7b0d3d2743b 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1009,6 +1009,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1314,7 +1320,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +-- +2.50.1 + diff --git a/cross/gcc-armv7/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch b/cross/gcc-armv7/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch new file mode 100644 index 000000000..8b25ba72d --- /dev/null +++ b/cross/gcc-armv7/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch @@ -0,0 +1,25 @@ +From bb98973bdb5fe8bd040e238afe92845203929b59 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:50:42 -0700 +Subject: [PATCH] gcc: params: set default ssp-buffer-size to 4 + +--- + gcc/params.opt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/params.opt b/gcc/params.opt +index 64e453d29b7..bba3fd574f2 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -1064,7 +1064,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-armv7/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch similarity index 88% rename from cross/gcc-riscv64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch rename to cross/gcc-armv7/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index f4dd52f19..c903a5cce 100644 --- a/cross/gcc-riscv64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-armv7/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,8 +1,8 @@ -From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001 +From f89d8e95b809d02eceee416b463200c9abb2b33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during - gcc bootstrapping. +Subject: [PATCH] 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 12d34910830..61b13762b71 100644 +index 7f84a99533e..a4c6284f788 100644 --- a/libstdc++-v3/po/Makefile.am +++ b/libstdc++-v3/po/Makefile.am @@ -38,6 +38,7 @@ MSGFMT = msgfmt @@ -50,5 +50,5 @@ index 8e93445acd2..d6ff06e5ddb 100644 all-local: all-local-$(USE_NLS) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-armv7/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch similarity index 73% rename from cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch rename to cross/gcc-armv7/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch index f56d41a57..48b22a5dc 100644 --- a/cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-armv7/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,17 +1,17 @@ -From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001 +From b45303198567828a5240baf932a8c13255f35d20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/35] Don't declare asprintf if defined as a macro. +Subject: [PATCH] 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 1d5c779fcff..19e3cb1e31c 100644 +index d4e8791b14b..c074980ed80 100644 --- a/include/libiberty.h +++ b/include/libiberty.h -@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *, +@@ -678,8 +678,11 @@ extern void *bsearch_r (const void *, const void *, /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. */ @@ -24,5 +24,5 @@ index 1d5c779fcff..19e3cb1e31c 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-armv7/0012-libiberty-copy-PIC-objects-during-build-process.patch similarity index 66% rename from cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch rename to cross/gcc-armv7/0012-libiberty-copy-PIC-objects-during-build-process.patch index b12d4f94b..ff49be1c6 100644 --- a/cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-armv7/0012-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,17 +1,17 @@ -From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001 +From 68e2c9356221ba30b27840b9449f742505584cf1 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/35] libiberty: copy PIC objects during build process +Subject: [PATCH] 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 72608f3e4a7..58356884728 100644 +index ce54d88278d..10c212a1ad3 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) +@@ -266,6 +266,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ @@ -20,5 +20,5 @@ index 72608f3e4a7..58356884728 100644 else true; fi -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0012-libgcc_s.patch b/cross/gcc-armv7/0013-libgcc_s.patch similarity index 76% rename from cross/gcc-aarch64/0012-libgcc_s.patch rename to cross/gcc-armv7/0013-libgcc_s.patch index 8189f8491..99152585f 100644 --- a/cross/gcc-aarch64/0012-libgcc_s.patch +++ b/cross/gcc-armv7/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001 +From ca482f8c9cac9617855f908dd30d3d6144e850a0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 12/35] libgcc_s +Subject: [PATCH] libgcc_s --- gcc/config/i386/i386-expand.cc | 4 ++-- @@ -9,9 +9,11 @@ Subject: [PATCH 12/35] libgcc_s libgcc/config/i386/t-linux | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) +diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc +index cdfd94d3c73..a3a6c988833 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc -@@ -13089,10 +13089,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -13643,10 +13643,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -24,6 +26,8 @@ Subject: [PATCH 12/35] libgcc_s call_expr = build_call_expr (fndecl, 0); return expand_expr (call_expr, target, mode, EXPAND_NORMAL); } +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index 2484dc839bf..e980030ef23 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -63,7 +63,7 @@ __cpu_indicator_init (void) @@ -37,6 +41,8 @@ Subject: [PATCH 12/35] libgcc_s +int __cpu_indicator_init_local (void) + __attribute__ ((weak, alias ("__cpu_indicator_init"))); #endif +diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux +index 8506a635790..564296f788e 100644 --- a/libgcc/config/i386/t-linux +++ b/libgcc/config/i386/t-linux @@ -3,5 +3,5 @@ @@ -46,3 +52,6 @@ Subject: [PATCH 12/35] libgcc_s -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.50.1 + diff --git a/cross/gcc-riscv64/0013-nopie.patch b/cross/gcc-armv7/0014-nopie.patch similarity index 79% rename from cross/gcc-riscv64/0013-nopie.patch rename to cross/gcc-armv7/0014-nopie.patch index 4a9ea0770..7117a9434 100644 --- a/cross/gcc-riscv64/0013-nopie.patch +++ b/cross/gcc-armv7/0014-nopie.patch @@ -1,16 +1,18 @@ -From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001 +From 6dfb241ae9f879f4945941273dd73eb13f127b06 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 13/35] nopie +Subject: [PATCH] nopie --- gcc/configure | 25 +++++++++++++++++++++++++ gcc/configure.ac | 11 +++++++++++ 2 files changed, 36 insertions(+) +diff --git a/gcc/configure b/gcc/configure +index 0f4a5d52c30..343563c8948 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \ +@@ -34586,6 +34586,29 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 $as_echo "$gcc_cv_no_pie" >&6; } @@ -40,7 +42,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then +@@ -34603,6 +34626,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -49,9 +51,11 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b0e3615e5aa..b3948469d17 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -7802,6 +7802,15 @@ AC_CACHE_CHECK([for -no-pie option], [gcc_cv_no_pie=yes], [gcc_cv_no_pie=no]) LDFLAGS="$saved_LDFLAGS"]) @@ -67,7 +71,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then +@@ -7819,6 +7828,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -76,3 +80,6 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0014-ada-fix-shared-linking.patch b/cross/gcc-armv7/0015-ada-fix-shared-linking.patch similarity index 90% rename from cross/gcc-riscv64/0014-ada-fix-shared-linking.patch rename to cross/gcc-armv7/0015-ada-fix-shared-linking.patch index ff6e42921..a893502b7 100644 --- a/cross/gcc-riscv64/0014-ada-fix-shared-linking.patch +++ b/cross/gcc-armv7/0015-ada-fix-shared-linking.patch @@ -1,14 +1,14 @@ -From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001 +From 8ac6aeca5d6192ee16b959bd8c1903a52d408a55 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 14/35] ada: fix shared linking +Subject: [PATCH] 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 f2126441208..22cfa9c641f 100644 +index 9e3385ca94f..2c0cca6e480 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; @@ -38,5 +38,5 @@ index f2126441208..22cfa9c641f 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-armv7/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch similarity index 70% rename from cross/gcc-armv7/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch rename to cross/gcc-armv7/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index ddea4a05b..a6adebb1f 100644 --- a/cross/gcc-armv7/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-armv7/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,12 +1,14 @@ -From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001 +From 7323d68ae46fc8e33c0746799d820a4e4c8c8b72 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + 1 file changed, 1 insertion(+) +diff --git a/Makefile.in b/Makefile.in +index b1ed67d3d4f..1e039c20550 100644 --- a/Makefile.in +++ b/Makefile.in @@ -179,6 +179,7 @@ BUILD_EXPORTS = \ @@ -17,3 +19,6 @@ Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing LDFLAGS="$(LDFLAGS_FOR_BUILD)" # This is the list of directories to built for the host system. +-- +2.50.1 + diff --git a/cross/gcc-armv7/0016-add-fortify-headers-paths.patch b/cross/gcc-armv7/0017-add-fortify-headers-paths.patch similarity index 80% rename from cross/gcc-armv7/0016-add-fortify-headers-paths.patch rename to cross/gcc-armv7/0017-add-fortify-headers-paths.patch index b554e0251..b4ecd2fd5 100644 --- a/cross/gcc-armv7/0016-add-fortify-headers-paths.patch +++ b/cross/gcc-armv7/0017-add-fortify-headers-paths.patch @@ -1,14 +1,14 @@ -From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001 +From eaf89c8c91806905c6e1ec9519cbfb56296204b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 16/35] add fortify-headers paths +Subject: [PATCH] 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 e3aca79cccc..b3537b8fbeb 100644 +index d6280a4d4dd..ba69fb9fad7 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -21,5 +21,5 @@ index e3aca79cccc..b3537b8fbeb 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-armv7/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch similarity index 68% rename from cross/gcc-aarch64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch rename to cross/gcc-armv7/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index 4796a055d..84731bb57 100644 --- a/cross/gcc-aarch64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-armv7/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,9 +1,9 @@ -From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001 +From bdedcd9db7b8291637c5147dd82e8a9e3f5f9c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 21 Aug 2020 07:03:00 +0000 -Subject: [PATCH 17/35] 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] 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. @@ -12,9 +12,11 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We gcc/gcc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 7b0d3d2743b..e46e976a2e8 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1008,8 +1008,7 @@ proper position among the other output files. */ +@@ -1017,8 +1017,7 @@ proper position among the other output files. */ #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP @@ -24,3 +26,6 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-armv7/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch similarity index 84% rename from cross/gcc-aarch64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch rename to cross/gcc-armv7/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index b829e5b34..b703be7a7 100644 --- a/cross/gcc-aarch64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-armv7/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,16 +1,18 @@ -From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001 +From 586ce3614d4fc3fbeccf01659114a4643c1879c8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- gcc/gcc.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e46e976a2e8..607c8ca1d42 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -772,10 +772,10 @@ proper position among the other output files. */ +@@ -775,10 +775,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 "}" \ @@ -23,7 +25,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -811,10 +811,10 @@ proper position among the other output files. */ +@@ -814,10 +814,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 "}" \ @@ -36,7 +38,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -832,10 +832,10 @@ proper position among the other output files. */ +@@ -835,10 +835,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 "}" \ @@ -49,7 +51,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -851,10 +851,10 @@ proper position among the other output files. */ +@@ -854,10 +854,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 "}" \ @@ -62,3 +64,6 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0019-aarch64-disable-multilib-support.patch b/cross/gcc-armv7/0020-aarch64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-riscv64/0019-aarch64-disable-multilib-support.patch rename to cross/gcc-armv7/0020-aarch64-disable-multilib-support.patch index 5a8148feb..f2ad4bd64 100644 --- a/cross/gcc-riscv64/0019-aarch64-disable-multilib-support.patch +++ b/cross/gcc-armv7/0020-aarch64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001 +From 0ca7f92018d0bc04a72655f3b130c9aaeea1b771 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:12:55 +0000 -Subject: [PATCH 19/35] aarch64: disable multilib support +Subject: [PATCH] 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 57bf4100fcd..172894b57ef 100644 +index 70e36b3299e..e00c3becd3f 100644 --- a/gcc/config/aarch64/t-aarch64-linux +++ b/gcc/config/aarch64/t-aarch64-linux @@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm @@ -22,5 +22,5 @@ index 57bf4100fcd..172894b57ef 100644 MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0020-s390x-disable-multilib-support.patch b/cross/gcc-armv7/0021-s390x-disable-multilib-support.patch similarity index 85% rename from cross/gcc-armv7/0020-s390x-disable-multilib-support.patch rename to cross/gcc-armv7/0021-s390x-disable-multilib-support.patch index ef2f449a4..7b71aa3bc 100644 --- a/cross/gcc-armv7/0020-s390x-disable-multilib-support.patch +++ b/cross/gcc-armv7/0021-s390x-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001 +From b48898c8fbd7828b81f407c74c25cf8e07fb73a4 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:13:59 +0000 -Subject: [PATCH 20/35] s390x: disable multilib support +Subject: [PATCH] s390x: disable multilib support multilib is not supported on Alpine GCC at present --- @@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0021-ppc64-le-disable-multilib-support.patch b/cross/gcc-armv7/0022-ppc64-le-disable-multilib-support.patch similarity index 95% rename from cross/gcc-riscv64/0021-ppc64-le-disable-multilib-support.patch rename to cross/gcc-armv7/0022-ppc64-le-disable-multilib-support.patch index dbdc78828..5281a006c 100644 --- a/cross/gcc-riscv64/0021-ppc64-le-disable-multilib-support.patch +++ b/cross/gcc-armv7/0022-ppc64-le-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001 +From 158d93ce86f3d311ce489d0740326027068ca721 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:33 +0000 -Subject: [PATCH 21/35] ppc64[le]: disable multilib support +Subject: [PATCH] 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 01a94242308..b3a76379c03 100644 +index f56b47c268e..c5f757a6284 100644 --- a/gcc/config/rs6000/t-linux64 +++ b/gcc/config/rs6000/t-linux64 @@ -28,8 +28,8 @@ @@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644 +MULTILIB_OSDIRNAMES += m32=../lib32 MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0022-x86_64-disable-multilib-support.patch b/cross/gcc-armv7/0023-x86_64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-riscv64/0022-x86_64-disable-multilib-support.patch rename to cross/gcc-armv7/0023-x86_64-disable-multilib-support.patch index 2b2f3e7f3..1e74e9462 100644 --- a/cross/gcc-riscv64/0022-x86_64-disable-multilib-support.patch +++ b/cross/gcc-armv7/0023-x86_64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001 +From 6957fc21caca80f5e01db15df6dc8de46c85167b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:54 +0000 -Subject: [PATCH 22/35] x86_64: disable multilib support +Subject: [PATCH] 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 138956b0962..bc03dab874f 100644 +index 64a4a20e64f..9a8eb8dd8d1 100644 --- a/gcc/config/i386/t-linux64 +++ b/gcc/config/i386/t-linux64 @@ -33,6 +33,6 @@ @@ -22,5 +22,5 @@ index 138956b0962..bc03dab874f 100644 +MULTILIB_OSDIRNAMES+= m32=../lib32 MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0023-riscv-disable-multilib-support.patch b/cross/gcc-armv7/0024-riscv-disable-multilib-support.patch similarity index 90% rename from cross/gcc-aarch64/0023-riscv-disable-multilib-support.patch rename to cross/gcc-armv7/0024-riscv-disable-multilib-support.patch index eb9ba90fc..cc136a04f 100644 --- a/cross/gcc-aarch64/0023-riscv-disable-multilib-support.patch +++ b/cross/gcc-armv7/0024-riscv-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001 +From fdcbe7ee4ce81cdf247966385c8d521ac3f5a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 3 Jan 2022 07:14:48 +0100 -Subject: [PATCH 23/35] riscv: disable multilib support +Subject: [PATCH] riscv: disable multilib support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -42,6 +42,8 @@ library. gcc/config/riscv/t-linux | 7 +++++-- 2 files changed, 5 insertions(+), 10 deletions(-) +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 282c77b6a7b..07adae3d59c 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see @@ -56,6 +58,8 @@ library. - "/usr/lib/ " - -#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi +diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux +index a6f64f88d25..f88776ec520 100644 --- a/gcc/config/riscv/t-linux +++ b/gcc/config/riscv/t-linux @@ -1,5 +1,8 @@ @@ -69,3 +73,6 @@ library. +MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) +-- +2.50.1 + diff --git a/cross/gcc-armv7/0025-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-armv7/0025-ada-libgnarl-compatibility-for-musl.patch deleted file mode 100644 index b7c1c5f2f..000000000 --- a/cross/gcc-armv7/0025-ada-libgnarl-compatibility-for-musl.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 25/35] ada: libgnarl compatibility for musl - ---- - gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ - gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- - 2 files changed, 3 insertions(+), 61 deletions(-) - -diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads -index 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 - PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; - -- function pthread_rwlockattr_setkind_np -- (attr : access pthread_rwlockattr_t; -- pref : int) return int; -- pragma Import -- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); -- - function pthread_rwlock_init - (mutex : access pthread_rwlock_t; - attr : access pthread_rwlockattr_t) return int; -@@ -470,11 +464,6 @@ package System.OS_Interface is - protocol : int) return int; - pragma Import (C, pthread_mutexattr_setprotocol); - -- function pthread_mutexattr_setprioceiling -- (attr : access pthread_mutexattr_t; -- prioceiling : int) return int; -- pragma Import (C, pthread_mutexattr_setprioceiling); -- - type struct_sched_param is record - 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 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 - pragma Import - (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); - -- function GNAT_has_cap_sys_nice return C.int; -- pragma Import -- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); - -- We do not have pragma Linker_Options ("-lcap"); here, because this - -- library is not present on many Linux systems. 'libcap' is the Linux - -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is - -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on - -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. - -- function Get_Ceiling_Support return Boolean; -- -- Get the value of the Ceiling_Support constant (see below). -- -- Note well: If this function or related code is modified, it should be -- -- tested by hand, because automated testing doesn't exercise it. -- -- ------------------------- -- -- Get_Ceiling_Support -- -- ------------------------- -- -- function Get_Ceiling_Support return Boolean is -- Ceiling_Support : Boolean := False; -- begin -- if Locking_Policy /= 'C' then -- return False; -- end if; -- -- declare -- function geteuid return Integer; -- pragma Import (C, geteuid, "geteuid"); -- Superuser : constant Boolean := geteuid = 0; -- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; -- pragma Assert (Has_Cap in 0 | 1); -- begin -- Ceiling_Support := Superuser or else Has_Cap = 1; -- end; -- -- return Ceiling_Support; -- end Get_Ceiling_Support; -- -- pragma Warnings (Off, "non-preelaborable call not allowed*"); -- Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-preelaborable call not allowed*"); - -- True if the locking policy is Ceiling_Locking, and the current process - -- has permission to use this policy. The process has permission if it is - -- running as 'root', or if the capability was set by the setcap command, -@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is - -- Init_Mutex -- - ---------------- - -+ pragma Warnings (Off, "formal parameter * is not referenced"); - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is -+ pragma Warnings (On, "formal parameter * is not referenced"); - Mutex_Attr : aliased pthread_mutexattr_t; - Result, Result_2 : C.int; - -@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is - return Result; - end if; - -- if Ceiling_Support then -- Result := pthread_mutexattr_setprotocol -- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); -- pragma Assert (Result = 0); -- -- Result := pthread_mutexattr_setprioceiling -- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); -- pragma Assert (Result = 0); -- -- elsif Locking_Policy = 'I' then -+ if Locking_Policy = 'I' then - Result := pthread_mutexattr_setprotocol - (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); - pragma Assert (Result = 0); -@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is - Result := pthread_rwlockattr_init (RWlock_Attr'Access); - pragma Assert (Result = 0); - -- Result := pthread_rwlockattr_setkind_np -- (RWlock_Attr'Access, -- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); -- pragma Assert (Result = 0); -- - Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); - - pragma Assert (Result in 0 | ENOMEM); --- -2.41.0 - diff --git a/cross/gcc-armv7/0024-always-build-libgcc_eh.a.patch b/cross/gcc-armv7/0025-always-build-libgcc_eh.a.patch similarity index 78% rename from cross/gcc-armv7/0024-always-build-libgcc_eh.a.patch rename to cross/gcc-armv7/0025-always-build-libgcc_eh.a.patch index 5d508ea08..5b21d4dd1 100644 --- a/cross/gcc-armv7/0024-always-build-libgcc_eh.a.patch +++ b/cross/gcc-armv7/0025-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001 +From 6f63901256443978a2c3746e72bd5762166a7790 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 24/35] always build libgcc_eh.a +Subject: [PATCH] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -9,9 +9,11 @@ highly inspired by: libgcc/Makefile.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index 0719fd0615d..80bb8f1622f 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -967,8 +967,9 @@ ifneq ($(LIBUNWIND),) +@@ -971,8 +971,9 @@ ifneq ($(LIBUNWIND),) all: libunwind.a endif @@ -22,7 +24,7 @@ highly inspired by: ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1173,10 +1174,6 @@ install-libunwind: +@@ -1177,10 +1178,6 @@ install-libunwind: install-shared: $(mkinstalldirs) $(DESTDIR)$(inst_libdir) @@ -33,7 +35,7 @@ highly inspired by: $(subst @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_base_name@,libgcc_s,$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -1193,6 +1190,10 @@ ifeq ($(enable_gcov),yes) +@@ -1197,6 +1194,10 @@ ifeq ($(enable_gcov),yes) $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a endif @@ -44,3 +46,6 @@ highly inspired by: parts="$(INSTALL_PARTS)"; \ for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.50.1 + diff --git a/cross/gcc-armv7/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch b/cross/gcc-armv7/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch new file mode 100644 index 000000000..e8fb24481 --- /dev/null +++ b/cross/gcc-armv7/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch @@ -0,0 +1,59 @@ +From a365def37f5de93ad85588d8e2c02c0df28e88d6 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:09:02 -0700 +Subject: [PATCH] ada: libgnarl: remove use of glibc-specific + pthread_rwlockattr_setkind_np + +musl's thread library does not implement it + +Signed-off-by: Ariadne Conill +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 10 ---------- + gcc/ada/libgnarl/s-taprop__linux.adb | 7 ------- + 2 files changed, 17 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 7aeb15da523..5551b701e5a 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -402,16 +402,6 @@ package System.OS_Interface is + (attr : access pthread_rwlockattr_t) return int; + pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy"); + +- PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0; +- PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; +- +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb +index 8f4c835baa7..6df36c7d8f4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -409,16 +409,9 @@ package body System.Task_Primitives.Operations is + Result : C.int; + + begin +- -- Set the rwlock to prefer writer to avoid writers starvation +- + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); +-- +2.50.1 + diff --git a/cross/gcc-armv7/0026-ada-musl-support-fixes.patch b/cross/gcc-armv7/0026-ada-musl-support-fixes.patch deleted file mode 100644 index 0be683fa6..000000000 --- a/cross/gcc-armv7/0026-ada-musl-support-fixes.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 26/35] ada: musl support fixes - ---- - gcc/ada/Makefile.rtl | 16 ++++++++-------- - gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- - gcc/ada/adaint.h | 10 ++++------ - gcc/ada/terminals.c | 8 ++++---- - 4 files changed, 35 insertions(+), 33 deletions(-) - ---- a/gcc/ada/Makefile.rtl -+++ b/gcc/ada/Makefile.rtl -@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) - s-intman.adb - #include - #endif -+ -+#if defined (linux) || defined(__linux__) -+#define _GNU_SOURCE 1 -+#include -+#endif - - #ifdef __PikeOS__ - #define __BSD_VISIBLE 1 -@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void) - #endif - - #if defined (__linux__) --#include - - /* glibc versions earlier than 2.7 do not define the routines to handle - dynamically allocated CPU sets. For these targets, we use the static -@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void) - - /* Dynamic cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count) - { - return CPU_ALLOC (count); -@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { -- CPU_FREE (set); -+ CPU_FREE ((cpu_set_t *) set); - } - - void --__gnat_cpu_zero (size_t count, cpu_set_t *set) -+__gnat_cpu_zero (size_t count, void *set) - { -- CPU_ZERO_S (count, set); -+ CPU_ZERO_S (count, (cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET_S (cpu - 1, count, set); -+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); - } - - #else /* !CPU_ALLOC */ - - /* Static cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) - { -- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); -+ return xmalloc (sizeof (cpu_set_t)); - } - - size_t -@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { - free (set); - } - - void --__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) - { -- CPU_ZERO (set); -+ CPU_ZERO ((cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET (cpu - 1, set); -+ CPU_SET (cpu - 1, (cpu_set_t *) set); - } - #endif /* !CPU_ALLOC */ - #endif /* __linux__ */ ---- a/gcc/ada/adaint.h -+++ b/gcc/ada/adaint.h -@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void); - - /* Routines for interface to required CPU set primitives */ - --#include -- --extern cpu_set_t *__gnat_cpu_alloc (size_t); -+extern void * __gnat_cpu_alloc (size_t); - extern size_t __gnat_cpu_alloc_size (size_t); --extern void __gnat_cpu_free (cpu_set_t *); --extern void __gnat_cpu_zero (size_t, cpu_set_t *); --extern void __gnat_cpu_set (int, size_t, cpu_set_t *); -+extern void __gnat_cpu_free (void *); -+extern void __gnat_cpu_zero (size_t, void *); -+extern void __gnat_cpu_set (int, size_t, void *); - #endif - - #if defined (_WIN32) ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1134,7 +1134,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) -- 2- getpt (USE_GETPT) -+ 2- posix_openpt (USE_POSIX_OPENPT) - 3- openpty (USE_OPENPTY) - - When using the cloning device method, the macro USE_CLONE_DEVICE should -@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, - #if defined (__APPLE__) || defined (BSD) - #define USE_OPENPTY - #elif defined (__linux__) --#define USE_GETPT -+#define USE_POSIX_OPENPT - #elif defined (__sun__) - #define USE_CLONE_DEVICE "/dev/ptmx" - #elif defined (_AIX) -@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { - int master_fd = -1; - char *slave_name = NULL; - --#ifdef USE_GETPT -- master_fd = getpt (); -+#if defined(USE_POSIX_OPENPT) -+ master_fd = posix_openpt(O_RDWR | O_NOCTTY); - #elif defined (USE_OPENPTY) - status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); - #elif defined (USE_CLONE_DEVICE) diff --git a/cross/gcc-armv7/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch b/cross/gcc-armv7/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch new file mode 100644 index 000000000..c138a6034 --- /dev/null +++ b/cross/gcc-armv7/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch @@ -0,0 +1,50 @@ +From e1572457f94a26da9a588a36afa3eb0e74122c34 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:13:19 -0700 +Subject: [PATCH] ada: libgnarl: use posix_openpt instead of glibc-specific + getpt to open a pty + +musl only implements posix_openpt(3), not the older glibc-specific getpt() +and glibc implements both for ages. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/terminals.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index 89f887556c0..93557fe2631 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1134,7 +1134,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) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + #if defined (__APPLE__) || defined (BSD) + #define USE_OPENPTY + #elif defined (__linux__) +-#define USE_GETPT ++#define USE_POSIX_OPENPT + #elif defined (__sun__) + #define USE_CLONE_DEVICE "/dev/ptmx" + #elif defined (_AIX) +@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) +-- +2.50.1 + diff --git a/cross/gcc-armv7/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch b/cross/gcc-armv7/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch new file mode 100644 index 000000000..0bf61bd9f --- /dev/null +++ b/cross/gcc-armv7/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch @@ -0,0 +1,54 @@ +From 4f26d4bfedb7f942b69ca4743f053c3a690a0b4a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:18:49 -0700 +Subject: [PATCH] ada: libgnarl: adaint: fix sched.h inclusion for musl + +Signed-off-by: Ariadne Conill +--- + gcc/ada/adaint.c | 6 +++++- + gcc/ada/adaint.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 1fcfae165a7..67318e647ed 100644 +--- a/gcc/ada/adaint.c ++++ b/gcc/ada/adaint.c +@@ -95,6 +95,11 @@ + #include + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 + #endif +@@ -3476,7 +3481,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 3df12b5f956..26a489f2b78 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -40,6 +40,11 @@ extern "C" { + #include "mingw32.h" + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #include + + /* Constants used for the form parameter encoding values */ +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-armv7/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch similarity index 86% rename from cross/gcc-aarch64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch rename to cross/gcc-armv7/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch index 0b92854c4..32c8c8724 100644 --- a/cross/gcc-aarch64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +++ b/cross/gcc-armv7/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch @@ -1,14 +1,14 @@ -From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001 +From 6592e702844d31bcef17c340bfc13e0e1be9f132 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 9 Dec 2020 07:42:06 +0000 -Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in +Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in LINK_GCC_C_SEQUENCE_SPEC [PR81358] This fixes issues with RISC-V. --- Makefile.in | 1 + - gcc/config/gnu-user.h | 12 +++++++++++- gcc/config.in | 6 ++++++ + gcc/config/gnu-user.h | 12 +++++++++++- gcc/configure | 31 ++++++++++++++++++++++++++++++- gcc/configure.ac | 21 +++++++++++++++++++++ gcc/doc/install.texi | 8 ++++++++ @@ -17,9 +17,11 @@ This fixes issues with RISC-V. gcc/gcc.cc | 12 +++++++++++- 9 files changed, 102 insertions(+), 5 deletions(-) +diff --git a/Makefile.in b/Makefile.in +index 1e039c20550..20f535a306a 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -237,6 +237,7 @@ HOST_EXPORTS = \ +@@ -238,6 +238,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; \ @@ -27,6 +29,25 @@ This fixes issues with RISC-V. HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ +diff --git a/gcc/config.in b/gcc/config.in +index 8a531ed591c..40045ff35a5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -131,6 +131,12 @@ + #endif + + ++/* Define if libatomic should always be linked. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_AUTOLINK_LIBATOMIC ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 3c17ac6eade..0426efdb8c3 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 @@ -49,24 +70,11 @@ This fixes issues with RISC-V. %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" #undef LINK_GCC_C_SEQUENCE_SPEC ---- a/gcc/config.in -+++ b/gcc/config.in -@@ -131,6 +131,12 @@ - #endif - - -+/* Define if libatomic should always be linked. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_AUTOLINK_LIBATOMIC -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET +diff --git a/gcc/configure b/gcc/configure +index 343563c8948..54300a2a867 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1002,6 +1002,7 @@ with_changes_root_url +@@ -1003,6 +1003,7 @@ with_changes_root_url enable_languages with_multilib_list with_multilib_generator @@ -74,7 +82,7 @@ This fixes issues with RISC-V. with_zstd with_zstd_include with_zstd_lib -@@ -1739,6 +1740,9 @@ Optional Features: +@@ -1742,6 +1743,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 @@ -84,7 +92,7 @@ This fixes issues with RISC-V. --disable-rpath do not hardcode runtime library paths --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling -@@ -8380,7 +8384,6 @@ else +@@ -8400,7 +8404,6 @@ else fi @@ -92,7 +100,7 @@ This fixes issues with RISC-V. # Check whether --with-multilib-generator was given. if test "${with_multilib_generator+set}" = set; then : withval=$with_multilib_generator; : -@@ -8388,6 +8391,32 @@ else +@@ -8408,6 +8411,32 @@ else with_multilib_generator=default fi @@ -125,9 +133,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b3948469d17..81c070830e2 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -1215,6 +1215,27 @@ AC_ARG_WITH(multilib-generator, +@@ -1227,6 +1227,27 @@ AC_ARG_WITH(multilib-generator, :, with_multilib_generator=default) @@ -155,9 +165,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs # ------------------------- +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 3e9e09b4ae3..6e7b756be61 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi -@@ -2525,6 +2525,14 @@ files, but these changed header paths may conflict with some compilation +@@ -2617,6 +2617,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}. @@ -172,6 +184,8 @@ This fixes issues with RISC-V. @item --with-glibc-version=@var{major}.@var{minor} 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 a96700c0d38..16deedca64d 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -189,6 +203,8 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in +index eccc4d88493..4ca4c610571 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -206,9 +222,11 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 607c8ca1d42..e9f78f0f4c1 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -991,13 +991,23 @@ proper position among the other output files. */ +@@ -1000,13 +1000,23 @@ proper position among the other output files. */ # define ASM_DEBUG_OPTION_SPEC "" #endif @@ -233,3 +251,6 @@ This fixes issues with RISC-V. #endif #ifdef ENABLE_DEFAULT_SSP +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-armv7/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch similarity index 90% rename from cross/gcc-riscv64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch rename to cross/gcc-armv7/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch index f92fc7bf4..5aed9caf5 100644 --- a/cross/gcc-riscv64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch +++ b/cross/gcc-armv7/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -1,8 +1,8 @@ -From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 +From 952070c1616f231a810af2da50264713d7587b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 29 Aug 2021 12:23:34 +0200 -Subject: [PATCH 28/35] configure: fix detection of atomic builtins in - libatomic configure script +Subject: [PATCH] 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 a92ae9e8309..90b579ca4d8 100644 +index 6db039d6e8b..2751b5c1387 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -30,6 +30,26 @@ @@ -53,5 +53,5 @@ index a92ae9e8309..90b579ca4d8 100644 alpha*) # fenv.c needs this option to generate inexact exceptions. -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-armv7/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch similarity index 78% rename from cross/gcc-riscv64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch rename to cross/gcc-armv7/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch index 4418cd5b5..2b7259a4d 100644 --- a/cross/gcc-riscv64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +++ b/cross/gcc-armv7/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch @@ -1,15 +1,15 @@ -From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001 +From 896b002a2afacb4d75d573aca4ae53b499df19cd Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 30 Jun 2022 16:44:51 +0000 -Subject: [PATCH 29/35] libstdc++: do not throw exceptions for non-C locales on - musl targets +Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl + targets --- libstdc++-v3/config/locale/generic/c_locale.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc -index 8849d78fdfa..aff467f98fe 100644 +index bfd02b5c2c6..16f9e84d66f 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 @@ -23,5 +23,5 @@ index 8849d78fdfa..aff467f98fe 100644 void -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-armv7/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch similarity index 66% rename from cross/gcc-armv7/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch rename to cross/gcc-armv7/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch index fde874c35..452ced2ee 100644 --- a/cross/gcc-armv7/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch +++ b/cross/gcc-armv7/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch @@ -1,17 +1,18 @@ -From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001 +From 22d69ae3e2768d301ef5a1f1b362c25cf8bf27b9 Mon Sep 17 00:00:00 2001 From: Mathias LANG Date: Mon, 17 Jan 2022 03:49:21 +0000 -Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against - libucontext +Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext ref: alpine/aports#13422 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/Makefile.in b/Makefile.in +index 20f535a306a..c087bfe7cd4 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -54362,7 +54362,7 @@ configure-target-libphobos: +@@ -54382,7 +54382,7 @@ configure-target-libphobos: esac; \ module_srcdir=libphobos; \ rm -f no-such-file || : ; \ @@ -20,3 +21,6 @@ ref: alpine/aports#13422 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0031-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-armv7/0033-druntime-link-against-libucontext-on-all-platforms.patch similarity index 81% rename from cross/gcc-aarch64/0031-druntime-link-against-libucontext-on-all-platforms.patch rename to cross/gcc-armv7/0033-druntime-link-against-libucontext-on-all-platforms.patch index 72f9370ee..920cf677e 100644 --- a/cross/gcc-aarch64/0031-druntime-link-against-libucontext-on-all-platforms.patch +++ b/cross/gcc-armv7/0033-druntime-link-against-libucontext-on-all-platforms.patch @@ -1,7 +1,7 @@ -From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001 +From dc66835022cf68085400f2eed30614c5afdc28a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sat, 16 Jul 2022 09:21:11 +0200 -Subject: [PATCH 31/35] druntime: link against libucontext on all platforms +Subject: [PATCH] druntime: link against libucontext on all platforms On musl-based Linux distributions, swapcontext etc. are not provided by musl but instead by libucontext. Hence, we _always_ need to link against @@ -11,9 +11,11 @@ an external library for these functions. libphobos/m4/druntime/libraries.m4 | 8 -------- 2 files changed, 16 deletions(-) +diff --git a/libphobos/configure b/libphobos/configure +index 4f5be7d4ff4..0a48032edb4 100755 --- a/libphobos/configure +++ b/libphobos/configure -@@ -15375,14 +15375,6 @@ fi +@@ -15420,14 +15420,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 @@ -28,6 +30,8 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 $as_echo_n "checking for library containing swapcontext... " >&6; } +diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 +index 8dd9c7da107..b61bf528a14 100644 --- a/libphobos/m4/druntime/libraries.m4 +++ b/libphobos/m4/druntime/libraries.m4 @@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], @@ -45,3 +49,6 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then AC_SEARCH_LIBS([swapcontext], [c ucontext], [], AC_MSG_ERROR([swapcontext required but not found])) +-- +2.50.1 + diff --git a/cross/gcc-armv7/0033-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-armv7/0033-libphobos-do-not-use-LFS64-symbols.patch deleted file mode 100644 index 138bd64b7..000000000 --- a/cross/gcc-armv7/0033-libphobos-do-not-use-LFS64-symbols.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 29 May 2023 15:33:11 +0000 -Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols - -musl does not have these since 1.2.4, we can't use the compat interfaces. ---- - libphobos/libdruntime/core/sys/posix/config.d | 2 +- - libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- - 2 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d -index ae6752f220e..6b80d1ff0e6 100644 ---- a/libphobos/libdruntime/core/sys/posix/config.d -+++ b/libphobos/libdruntime/core/sys/posix/config.d -@@ -88,7 +88,7 @@ else version (CRuntime_Musl) - enum __REDIRECT = false; - - // Those three are irrelevant for Musl as it always uses 64 bits off_t -- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64; -+ enum __USE_FILE_OFFSET64 = false; - enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT; - enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT; - -diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d -index 0d3d517d69a..323aa0af72d 100644 ---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d -+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d -@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) - } - else version (CRuntime_Musl) - { -- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); -- static if (__USE_FILE_OFFSET64) -- alias mmap = mmap64; -- else -- void* mmap(void*, size_t, int, int, int, off_t); -+ void* mmap(void*, size_t, int, int, int, off_t); - int munmap(void*, size_t); - } - else version (CRuntime_UClibc) --- -2.41.0 - diff --git a/cross/gcc-armhf/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-armv7/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch similarity index 64% rename from cross/gcc-armhf/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch rename to cross/gcc-armv7/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch index b53e5847d..38354fa65 100644 --- a/cross/gcc-armhf/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +++ b/cross/gcc-armv7/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch @@ -1,15 +1,17 @@ -From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001 +From ab88348da140c68e5e1142041dbe1c7b7d9c9a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 19 Jul 2022 14:54:07 +0200 -Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc +Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc --- gcc/ada/libgnat/s-parame.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 98284a4d13e..0d14f116a10 100644 --- a/gcc/ada/libgnat/s-parame.ads +++ b/gcc/ada/libgnat/s-parame.ads -@@ -100,7 +100,7 @@ package System.Parameters is +@@ -101,7 +101,7 @@ package System.Parameters is -- Characteristics of time_t type -- ------------------------------------ @@ -18,3 +20,6 @@ Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc -- Number of bits in type time_t ---------------------------------------------- +-- +2.50.1 + diff --git a/cross/gcc-armv7/0035-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-armv7/0035-libphobos-do-not-use-LFS64-symbols.patch new file mode 100644 index 000000000..692f764f6 --- /dev/null +++ b/cross/gcc-armv7/0035-libphobos-do-not-use-LFS64-symbols.patch @@ -0,0 +1,30 @@ +From f865fb0a27252bd3a01fc4596f101d389929311c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 29 May 2023 15:33:11 +0000 +Subject: [PATCH] libphobos: do not use LFS64 symbols + +musl does not have these since 1.2.4, we can't use the compat interfaces. +--- + libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d +index b1eb9fa8107..3aee0d96319 100644 +--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d ++++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d +@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) + } + else version (CRuntime_Musl) + { +- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); +- static if (__USE_FILE_OFFSET64) +- alias mmap = mmap64; +- else +- void* mmap(void*, size_t, int, int, int, off_t); ++ void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); + } + else version (CRuntime_UClibc) +-- +2.50.1 + diff --git a/cross/gcc-armhf/0034-libgo-fix-lfs64-use.patch b/cross/gcc-armv7/0036-libgo-fix-lfs64-use.patch similarity index 98% rename from cross/gcc-armhf/0034-libgo-fix-lfs64-use.patch rename to cross/gcc-armv7/0036-libgo-fix-lfs64-use.patch index cf47858d6..355edd642 100644 --- a/cross/gcc-armhf/0034-libgo-fix-lfs64-use.patch +++ b/cross/gcc-armv7/0036-libgo-fix-lfs64-use.patch @@ -1,7 +1,7 @@ -From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001 +From cf6ba089ba26cd970962e874a3e35f020c3e921c Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 10 Jul 2023 23:23:29 +0000 -Subject: [PATCH 34/35] libgo: fix lfs64 use +Subject: [PATCH] libgo: fix lfs64 use --- .../go/internal/syscall/unix/at_largefile.go | 2 +- @@ -191,5 +191,5 @@ index 180f5c31d74..1d717d55c0e 100644 EREF(PRIO_USER); EREF(RUSAGE_SELF); -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armv7/0036-libphobos-add-riscv64-and-loongarch64-support.patch b/cross/gcc-armv7/0036-libphobos-add-riscv64-and-loongarch64-support.patch deleted file mode 100644 index ba8377b1d..000000000 --- a/cross/gcc-armv7/0036-libphobos-add-riscv64-and-loongarch64-support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Celeste -Date: Mon, 2 Sep 2024 02:54:17 +0000 -Subject: [PATCH] libphobos: add riscv64 and loongarch64 support - -Add musl support for these 2 architectures based on fenv.h and signal.h from: - -https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5 - -https://git.musl-libc.org/cgit/musl/tree/arch/loongarch64/bits?h=v1.2.5 ---- - libphobos/libdruntime/core/stdc/fenv.d | 13 +++++++++++++ - libphobos/libdruntime/core/sys/posix/signal.d | 10 ++++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d -index a7364c0a..5b327e4a 100644 ---- a/libphobos/libdruntime/core/stdc/fenv.d -+++ b/libphobos/libdruntime/core/stdc/fenv.d -@@ -436,20 +436,33 @@ else version (CRuntime_Musl) - ushort __cs_selector; - ushort __opcode; - uint __data_offset; - ushort __data_selector; - ushort __unused5; - version (X86_64) - uint __mxcsr; - } - alias ushort fexcept_t; - } -+ else version (RISCV64) -+ { -+ alias uint fenv_t; -+ alias uint fexcept_t; -+ } -+ else version (LoongArch64) -+ { -+ struct fenv_t -+ { -+ uint __cw; -+ } -+ alias uint fexcept_t; -+ } - else - { - static assert(false, "Architecture not supported."); - } - } - else version (CRuntime_Newlib) - { - version (AArch64) - { - alias fenv_t = ulong; -diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d -index a8b7f751..78d8b3cd 100644 ---- a/libphobos/libdruntime/core/sys/posix/signal.d -+++ b/libphobos/libdruntime/core/sys/posix/signal.d -@@ -2751,20 +2751,30 @@ else version (CRuntime_Musl) - else version (PPC_Any) - { - enum MINSIGSTKSZ = 4096; - enum SIGSTKSZ = 10240; - } - else version (X86_Any) - { - enum MINSIGSTKSZ = 2048; - enum SIGSTKSZ = 8192; - } -+ else version (RISCV64) -+ { -+ enum MINSIGSTKSZ = 2048; -+ enum SIGSTKSZ = 8192; -+ } -+ else version (LoongArch64) -+ { -+ enum MINSIGSTKSZ = 4096; -+ enum SIGSTKSZ = 16384; -+ } - else - static assert(0, "unimplemented"); - - //ucontext_t (defined in core.sys.posix.ucontext) - //mcontext_t (defined in core.sys.posix.ucontext) - - version (MIPS_Any) - { - struct stack_t - { diff --git a/cross/gcc-armv7/0035-loongarch-disable-multilib-support.patch b/cross/gcc-armv7/0037-loongarch-disable-multilib-support.patch similarity index 87% rename from cross/gcc-armv7/0035-loongarch-disable-multilib-support.patch rename to cross/gcc-armv7/0037-loongarch-disable-multilib-support.patch index acfc47c7f..da7e8b34d 100644 --- a/cross/gcc-armv7/0035-loongarch-disable-multilib-support.patch +++ b/cross/gcc-armv7/0037-loongarch-disable-multilib-support.patch @@ -1,15 +1,15 @@ -From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001 +From a809e7b909e16fcf3379571417d33574e9c1dbff Mon Sep 17 00:00:00 2001 From: Jingyun Hua Date: Mon, 7 Aug 2023 15:25:58 +0800 Subject: [PATCH] loongarch disable multilib support Signed-off-by: Jingyun Hua --- - gcc/config/loongarch/t-linux | 11 +++-------- + gcc/config/loongarch/t-linux | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux -index 23e1fb979..c2753abb8 100644 +index 45862048abf..73155acd832 100644 --- a/gcc/config/loongarch/t-linux +++ b/gcc/config/loongarch/t-linux @@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) @@ -28,5 +28,5 @@ index 23e1fb979..c2753abb8 100644 + MULTILIB_OSDIRNAMES += mabi.lp64f=../lib + MULTILIB_OSDIRNAMES += mabi.lp64s=../lib -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0037-static-pie.patch b/cross/gcc-armv7/0038-static-PIE-ensure-static-reaches-the-linker.patch similarity index 72% rename from cross/gcc-riscv64/0037-static-pie.patch rename to cross/gcc-armv7/0038-static-PIE-ensure-static-reaches-the-linker.patch index a31c20e7e..bd870a370 100644 --- a/cross/gcc-riscv64/0037-static-pie.patch +++ b/cross/gcc-armv7/0038-static-PIE-ensure-static-reaches-the-linker.patch @@ -1,17 +1,26 @@ -Patch-Source: https://github.com/richfelker/musl-cross-make/blob/6f3701d08137496d5aac479e3a3977b5ae993c1f/patches/gcc-14.2.0/0004-static-pie.diff +From 72606254a2456763cb252b4d729a9505e77e449d Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Fri, 25 Jul 2025 02:41:46 -0700 +Subject: [PATCH] static PIE: ensure -static reaches the linker -gcc doesn't enable static-pie for all arches. As of this writing arm -32-bit is missing. musl supports static-pie on all arches so this -should be allowed on all arches. +on some targets, the logic for the compiler option -static seems not +to be processed when -pie is present. rather than playing +whack-a-mole, just ensure LD_PIE_SPEC specs always pass -static to ld +if either -static or -static-pie is present on the compiler driver +command line. -Without this patch binaries with (only) -static-pie are broken on some -arches. +this may produce redundant -static arguments but it doesn't matter. +--- + gcc/common.opt | 4 ++-- + gcc/config/gnu-user.h | 17 ++++++++--------- + gcc/gcc.cc | 6 +++--- + 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 +index e65a575d9f8..7ad38711f6e 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver +@@ -3968,11 +3968,11 @@ Driver no-pie Driver RejectNegative Negative(shared) @@ -26,7 +35,7 @@ index a75b44ee47e..7c564818b49 100644 static-pie Driver RejectNegative Negative(pie) diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 +index 0426efdb8c3..866c8bd77f2 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -70,12 +79,12 @@ index 5ebbf42a13d..bb907d8e89a 100644 +#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " #endif - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ + #if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) diff --git a/gcc/gcc.cc b/gcc/gcc.cc -index 3c81c5798d8..cd96eac5d12 100644 +index e9f78f0f4c1..767ff65f348 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ +@@ -1056,7 +1056,7 @@ proper position among the other output files. */ #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" #else @@ -84,12 +93,12 @@ index 3c81c5798d8..cd96eac5d12 100644 #define FPIE1_SPEC "fpie" #define NO_FPIE1_SPEC FPIE1_SPEC ":;" #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ +@@ -1080,12 +1080,12 @@ proper position among the other output files. */ #ifndef LINK_PIE_SPEC #ifdef HAVE_LD_PIE #ifndef LD_PIE_SPEC -#define LD_PIE_SPEC "-pie" -+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic %{static-pie:-static}}" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic -static}" #endif #else #define LD_PIE_SPEC "" @@ -99,3 +108,6 @@ index 3c81c5798d8..cd96eac5d12 100644 #endif #ifndef LINK_BUILDID_SPEC +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-armv7/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch similarity index 97% rename from cross/gcc-aarch64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch rename to cross/gcc-armv7/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch index b55477e53..c713030bb 100644 --- a/cross/gcc-aarch64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +++ b/cross/gcc-armv7/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch @@ -1,4 +1,4 @@ -From 49926c2c657dd867f7329df6e250913fd1425475 Mon Sep 17 00:00:00 2001 +From d984c5c9ed973bb7072b48399e5d9bb1f35c3123 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 28 Mar 2025 17:25:56 -0700 Subject: [PATCH] except: Don't use the cached value of the gcc_except_table @@ -73,5 +73,5 @@ index 00000000000..50afa75a43f +// There should be 3 exception tables, +// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } -- -2.49.0 +2.50.1 diff --git a/cross/gcc-armv7/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch b/cross/gcc-armv7/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch new file mode 100644 index 000000000..a25266014 --- /dev/null +++ b/cross/gcc-armv7/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch @@ -0,0 +1,164 @@ +From 57eb290b3c8fc36da99213f5050b46cd93575234 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Sat, 26 Jul 2025 02:59:45 -0700 +Subject: [PATCH] ada: libgnat: use stub symbolic module name functions + +The "linux" implementation depends on glibc internals and accordingly +does not work on musl. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/Makefile.rtl | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index cb41e6887cd..152ba70db4d 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1642,7 +1642,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb +Date: Sat, 26 Jul 2025 03:02:38 -0700 +Subject: [PATCH] ada: libgnat: recognize linux-musleabi and linux-muslgnueabi + platforms for ARM + +--- + gcc/ada/Makefile.rtl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 152ba70db4d..89574cdfba7 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2500,7 +2500,7 @@ endif + + # ARM linux, GNU eabi + ifeq ($(SELECTED_PAIRS),PAIRS_NONE) +-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),) ++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),) + + SELECTED_PAIRS=arm-linux-gnueabi + +-- +2.50.1 + diff --git a/cross/gcc-armv7/APKBUILD b/cross/gcc-armv7/APKBUILD index 31b31c932..6f6526863 100644 --- a/cross/gcc-armv7/APKBUILD +++ b/cross/gcc-armv7/APKBUILD @@ -24,7 +24,7 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-armv7 -pkgver=14.3.0 +pkgver=15.1.1_git20250719 # i.e. 13.2.1, must match gcc/BASE-VER _pkgbase="${pkgver%%_git*}" # date component from snapshots @@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-armv7 -pkgrel=6 +pkgrel=2 pkgdesc="Stage2 cross-compiler for armv7" url="https://gcc.gnu.org" arch="x86_64" @@ -183,7 +183,7 @@ if $_libgomp; then fi case "$CTARGET_ARCH" in -riscv64|loongarch64) +riscv64) LANG_ADA=false;; esac @@ -241,7 +241,7 @@ fi # PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches, # so that they can be properly tracked and easily rebased if needed. #source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz -source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz +source="https://gcc.gnu.org/pub/gcc/snapshots/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-specs-turn-on-Wl-z-now-by-default.patch @@ -249,37 +249,40 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch 0006-Enable-Wformat-and-Wformat-security-by-default.patch 0007-Enable-Wtrampolines-by-default.patch - 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch - 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch - 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch - 0011-libiberty-copy-PIC-objects-during-build-process.patch - 0012-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-libphobos-do-not-use-LFS64-symbols.patch - 0034-libgo-fix-lfs64-use.patch - 0035-loongarch-disable-multilib-support.patch - 0036-libphobos-add-riscv64-and-loongarch64-support.patch - 0037-static-pie.patch - 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch + 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch + 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0012-libiberty-copy-PIC-objects-during-build-process.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-ada-fix-shared-linking.patch + 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0017-add-fortify-headers-paths.patch + 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0020-aarch64-disable-multilib-support.patch + 0021-s390x-disable-multilib-support.patch + 0022-ppc64-le-disable-multilib-support.patch + 0023-x86_64-disable-multilib-support.patch + 0024-riscv-disable-multilib-support.patch + 0025-always-build-libgcc_eh.a.patch + 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch + 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch + 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch + 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch + 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch + 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch + 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch + 0033-druntime-link-against-libucontext-on-all-platforms.patch + 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch + 0035-libphobos-do-not-use-LFS64-symbols.patch + 0036-libgo-fix-lfs64-use.patch + 0037-loongarch-disable-multilib-support.patch + 0038-static-PIE-ensure-static-reaches-the-linker.patch + 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch + 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " # secfixes: @@ -287,8 +290,8 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz # - CVE-2023-4039 # we build out-of-tree -#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap -builddir="$srcdir"/gcc-$_pkgbase +builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap +#builddir="$srcdir"/gcc-$_pkgbase _gcclibdir="usr/lib/gcc/$CTARGET/$_pkgbase" _gcclibexec="usr/libexec/gcc/$CTARGET/$_pkgbase" @@ -752,43 +755,46 @@ gdb() { } sha512sums=" -cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93 gcc-14.3.0.tar.xz -1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch -6dd1eecbc050e30e5a0493969a0e80507d971f4ca87c06466f725fa50c9106e18aef86453fc8a80cd277438b6e79695a99cdaf2eaeb2f1add7e28f7cffd0cd2f 0002-gcc-poison-system-directories.patch -b6903b60b01187bfebc961e74d01ff5d8dc2852747663dff2b4a4f66df4b5aa412347fe92926cce1821fdd0c59d088404acbbced4b464aba9664d599a9e1bbce 0003-specs-turn-on-Wl-z-now-by-default.patch -d41a519ea5014e9ab49f017d3793e2a0a82429c2b7ded2776f2df7a2d0ac02aa294e7dbe74e027fe7c844c87525d483e0eda3846cf16340eb02e934389cfd838 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e34d7bb51c4c413b1a10bafcdfd5729fb5980b0288277ef44ed4779700d443d2fd22129b3b22d401def140851263e803160d2f3ed8825b0bf4f3fb8606db77bd 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -83665b6adb0b8080245b253abe3344ee5106ac2bc248aad9bef713b22b644a268d75c75fbab7554e0543836903a89bc4f0bec4b6d6d4e3d5ba355dddbc5ba190 0006-Enable-Wformat-and-Wformat-security-by-default.patch -ca5757a32f02bb24bc5b42bb03dca49fb9f9e6f34776343f1c5580efd2bcacf8c5b59f4b61652fa3ea1506eb14bcd390f5fda7b4cbfd32f7d1a750d14add4739 0007-Enable-Wtrampolines-by-default.patch -e476da4c2f29a941b7f4f1dfc9a37ba82b439badc47fc3fb72630ec5620f64849bdb66d339e0182674a0ee898a75564ffaf702986b770bfd793e7fbdcaa9f21b 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch -b40b6cbc3725ae88c506bc39a8ba10cfcdcc208fa26d667393bbb80e24346da2ccfac3ff914bb9fc4c374f022fa7f913e6873b9a66a96b79a1ac84959c9d5348 0012-libgcc_s.patch -6cc2c00b15d259289fa9831b60b58f8afdf09858410bd08ab3d839a45c6f3fb9e8e214dab851d105c61df7965f1c10255c84b5b6301630a390b27b8929a25e1e 0013-nopie.patch -0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch -7640e71cd957066e2e07ffcec1f8540cd6b1bdaf976c980693bf6f5d3afaf51ca7e41c62f92cb13c86c2dea9eb9cd799b2e3ea77d74926e82bf1e12bb7a4d64e 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch -8a8c9dc96f300f660f1a643c800352383f32db258dfcfa88a44159a38bb81a7298089a5dcb23906002c85cafc806caf6f3db0e1cb26fcac6192ae1e41d9ada3a 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -6c1cbfcf9e6f54b2173af39bbbfd97e7c18ae32a690fb4c6b1e35fa183992ea0f8046d479be57b6ac7d798bf2a6dade4f9ea3e3a839dc6fb8d47203de9c89e25 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch -a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch -f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch -44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch -0ef65a344975b641343767e289578ba5b0fd381c7177ebe4558cb67d8b41e33e3b825478fa46852f1f40ec9119ff908cf75ee36307266aea13f39460e080b0b6 0023-riscv-disable-multilib-support.patch -55438233a217dc1ee58990413b8782b9bd560a1532c1e6c860f377072ed1bdf75d5dc2458ed33194040ec5427c30df3fa68948dcd26de90e3803d3f7b784becd 0024-always-build-libgcc_eh.a.patch -8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch -02e8358b8855fb49bbb2b3ef293cff67441c5fdf1f2fee4dcec86ef1fd4f701e899ea9c7e072d888b0f1e674d7874d3085138f3deb9845d1f2e35d4a1fe3f5ab 0026-ada-musl-support-fixes.patch -8eff7679140f9e39f1a0ac2e4a6cc7e131efa3d5a669696dd28300eb5d75ef3be62f10c1b91d8f8c8ba2cba1ff9cf121228b6fcd3adafa28389ac63698e7d5a7 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch -720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch -2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch -458c9b121e00cec4d0dbe1d18c5e5332342eb0a3429129e5a9d9ace3247c31d85571ad9f47046c4ed3bc62e5d8a4297f48744a30424a19acbdd9aa484e3ee715 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch -099103f4b0b4612ff4bd2e8721cf1593415b636bff74d4feba304bb610ced6f4951cb3ab89088111e58029a2f9bf4a5dcc91e2b2afe4dd9813d2fa6b0999a5a2 0031-druntime-link-against-libucontext-on-all-platforms.patch -21ff4d55eec48ad4a9db0cd359e760cff548f7f6b1a67759a2e87fc7e16a262d82d2f980d309a3ce5e14097665beeb5516a5f2d98869a5d28345e685c6fe689d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch -c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch -c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch -65df1d489e8d07a811f39e27fd29e3b2b4164fbc2c5fdc16a5142886d94a96e3fb28ccf4f20dd297ba6540ef8ea1ac3eb65a4279494639bf2f0f8376a3896cc3 0035-loongarch-disable-multilib-support.patch -06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch -8249ce989c1a76bcb5bbb1123ef88d88f220b709fe6ac804f18c905a7b31c4e68ef6f5cc2236f446feed89fa773a3aed996a6aba7618e73a000d73cb0b0753f6 0037-static-pie.patch -90b6148d47f39caf1b70416abf2a09f4ce048491f784f56bd659dbf99e2c9f6a44b244827f23977494ab4e42640c49c1dc79f43a4d69c2b31c4b1e25d54d8142 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +a5e0082e492502385565479201bca3e9f5138a55d83540bff8b84a94d958c4d2afce474328656ee7d55fad910c04523c0068efe92382e68a327a65f6e641b88a gcc-15-20250719.tar.xz +fd5cebc5deb1d588583424acbc1b5a6d8d6f5b1bfa9f4bdbc082cfd406723f423d87011ee30e04ed18128a7ed8021cbfc9262becff5419125dc1afb6f407defa 0001-posix_memalign.patch +6634004cb9feea9ee0d063d6b6984d7db3b10c692b6139bb99169a4f2d74f0e10b5ca0ab31ce346ffef34b8eb9c3f536aa4d94bce1b27f8e0b8a9fc5cc4b7057 0002-gcc-poison-system-directories.patch +37e089791dbcbad73af866b662cda611dc0970d93e28251c7a9aa898db3b96446654e8b778d7866eb8550ba7f4a57cf22e8514d562bfed0c66613e65550d9c85 0003-specs-turn-on-Wl-z-now-by-default.patch +d4d5bfeb20a9fac968f37497d86d7eff4a9ac863e015dadbffae24c08236f5efde69b615d95191e2546672ce2d4b30d3627528c64a83fc64b715e8fa6fd4c372 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +b77cd1ee887fc52afee2fafd2d338f70a62c115017aa4fcb0ab9cf82b8a003794f75b7913cc153c767c351d2be8e1e7c113f893edee818217f20cad3cb6a2e66 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +af634de360e8b7aef285702815affb16da667719b786848ccdb9e4cca2a27826793f64c903a32a5d8ba1953965a5cc8999c58e2b6ce9ef36f74807e495cc9e42 0006-Enable-Wformat-and-Wformat-security-by-default.patch +21ad1cd4b7ef652ddaf6b9fb8071a87ec2fc694e8c420a79baf456347b8e1db5930a914c92a375943dda63d096c4823a2b8028d02a5b49c9bcdab5c170558004 0007-Enable-Wtrampolines-by-default.patch +dcd07ecf0daad8743a378abbcb921d4b17e528651a596454956563a3417fe9ea3b88dce7b15b9270f55ae2ea2a72efe8a7215236d0a21e2942c7c5ba0e8e2c39 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch +488bd530e209e3213f83d695fb2ac529c408e3dba9024457594cfb0d266acb079447bca184fbf136bacd1f1ec5ca3607dc4998b66630af9781ea7ee41c16236b 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch +7229a3fe655e8460148e0cd4c39d7362e713d1a6215530547f346371a5e3647245123637e8b075c58c5e7e35c823d96a0b3cdbedb6c07b5095507b4499bc053a 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +f7c1870bda4d418380f471b520b7cf20fde743f57415323c1a8898a815f8c7023adc3882e1d0453c5b6fcb65a27a9534fdeb297bf451453a95d90c0395e42c3b 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch +140c8165726404da0fc0ea01add2a7fa307377817968177334c520bdaabc23e8ec5d76f80337b89ff03edfd52dead7119433a03d2165e24780dc944633a9c2a3 0012-libiberty-copy-PIC-objects-during-build-process.patch +af848ef58b63a7592ad0f549be65fbe8dcd3c1e5ea9f30cfa65be02519ca9826d7612131c3b0042615b7537683d74eeb6849aba61810b0d8ed1c79f968188260 0013-libgcc_s.patch +c97b473c08b46090b48764af55b244ec70a13d26f2d881c57761abbc4a1c481da9766f33e59daee7188bc06c4631e53becbaf8801d0b35ca0b5fe84cb6a840f7 0014-nopie.patch +9c37cc38bb7238058751d3ff60712acd4134aa4c28d946c453b8b230bd6ba34c45c47a4b4d7e74aa7e3ed8dfc74cbb1d5a328bda706dd3037320e02a15421b86 0015-ada-fix-shared-linking.patch +b4afb30431ecdfd86acfd66ba857c275628b55e91cc9b21c18ca0e795b2fadfe895da801978a8e818ff9c93144075e72cf0521f3bce5c6c1d44e47e1b77b8ba4 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +6260341ed13926ce449cf351ada85d8e28fc7da63a4ae73b69c24fb2e8d0e3003ffacb1bb0f957185b8d5d7e013f777f7f696c9a1c94b2204a9b3e8274ec2f43 0017-add-fortify-headers-paths.patch +8fe954daf7e9b1d221f0536f54186bc1715e23cf3c74dfd0956c0fa22ce3b5b5e30b5e17ea584db1cc193ac7fdc72daff68c9163dbc46a837e01d25a7a4a90e0 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +fc5ce12cd70382b15317931ff0f57ae1ed10e8c09dbf2fee627bc55a268f55ebbf9ae32b89b4ef6f51e9a9b7ca32eed201245d481cde88f6eb572d40134f5f4c 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +e0d4fd0e0bf4ecfb517b60b55d73f326deda0faa75bfd07d1fcae116f91088a96caaa2dd20e2e38a93cc8ffed0aef422c0c861879c8de406364faef0cbcd50ff 0020-aarch64-disable-multilib-support.patch +7af318ea6fe14dce98b8db1f8f46a2dc9f75c2f27e63a52c62c7b47d6d62cb64748d5c2690eba772d931ff96ac089e3f03bf46b49122ffb5a03a1c186f01ae11 0021-s390x-disable-multilib-support.patch +b96dbbd0e1aa98ebc2e7eaa2a44912681e4c8bc9a129fafa53a943d67b62451b6d4fad53f92429cd4346a753527359c8c09d58836cf0968a56f5fe933496a412 0022-ppc64-le-disable-multilib-support.patch +60106cb08f27c89509ba46dc2ff0edecc1f4c7973874c85047dfdd67eabe50e3a852d7540002a09bcb6185c786a5daeba7915958c441fc92d7f16a0cce5bcdea 0023-x86_64-disable-multilib-support.patch +d55d65242af9341eef7f1e3d03fec2e2de75632a23ed83df4fe6304619f62127b42eba9d9286f7f3647e3b9bd95aaeb79023263e71ff9d58c47f3051b73d8bc2 0024-riscv-disable-multilib-support.patch +b6dda179cafbd9e7f3ef7e137b303a76491a0157d68f1504dee6611cecdca16d27ca32cbd2298da2f6301e7167b8730d70a775ee5ba88ae3773adef8421efa98 0025-always-build-libgcc_eh.a.patch +95245b6548ddca5065bac06131294028767a32740c80f707a4d1cf8653a0398305ec68e7c44a3f2912741b792d41048f03729657b0a1c1a2a7bff097c6b2fdc7 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch +ff6b8b9e1ab9b45d1853e74befb5c904cf7cd83dadb5a4b6f8c94a75e6249d1cdaa72aef73d6b1045beabc2d9012ea869d886015ec3aae561eb4ba8b9d00c2d7 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch +0582f00e8801df06e51fca45a8dc3ee62e9b6ce9245af98937f435c90c709edc7eb9071569c0e59c9a143d964fe5731b9e11b011174443b97043abddc9db1cce 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch +8683314212c0a6f49ed45ea8c74908f59d863822fa8c99e94c7e39ba3a642ca6a3167543e1ae4b58d8acd1ff97824d6e60cc432b19e6580cad2027e3a5c37603 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +60bb67f6cf4b92243dec861fba702aa5847925bf413c2c83705a0ee4ebe4c523cc295cce29666c69c9b2dec70d63def83cd9074e613b4f46e014248f53c87db4 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch +b49f72cce409f74407761fe64b028e97d58e4f236af7d9099189a8553f2ece3f30559760fab768f3d1fc4c7f89ae3ee6d687018251f3df52c9a43817c9c7c93e 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +0bd3aa81590d5f47205e193d2998bb5986cbb82adb75e3d39dcf820625bb358d380d1695ebbb18437fdd935ce350b0f5b7364a5fa7c8e07ebe8f972c8cd46cd1 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch +e8d5c4159f41fcb09e76758768d127ff366c93095137b694a405e9dbba88f2036ba64b69ac6c5c75e488be3281a1227cccbadcea2bef6f60ba0be7fc3d7db754 0033-druntime-link-against-libucontext-on-all-platforms.patch +6f530cdb1935296925ec29be7a30e4d69cebc155695db6ea30ee95ce65de7e8917e2a6148d3668974715120e7f13f734e5c36bfd35f707f4725a7556cbc1caa5 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +1dabb0c8d581ec86d8758dfa3d2f1713d915f6d927639f56b3590ed9b0885dfdf452e30ca87edac49721d2dc43d4fbdb4d178f8448e8ba5cc595457f216bf210 0035-libphobos-do-not-use-LFS64-symbols.patch +b915a0eaf7cc3e48f41f31ebbd9142760891b9ede304ff3f1dc7166f85a9e3f82017a17bb7e65824d3da07445b2c8bcd156a992eed92633362c08329b04b6cb4 0036-libgo-fix-lfs64-use.patch +0164467e66719187b6041c8d2d717a9bcd5b8c801dab6391b0e503c41e26518cc78389c97bdd2b2bc64f660f95410439aaa8a20799ec01eab17e7ba415ac1dd9 0037-loongarch-disable-multilib-support.patch +2cae2cb470b2cf469973c0ff3a7a020960cf4325502ff6c84c6b1b3514c8cacfae8452b5c79b55e657b0877fc9d81cc68db6f650156ca6d1376c1bd1a2290d8b 0038-static-PIE-ensure-static-reaches-the-linker.patch +7d73041566678fc86885877d8315481bf358858cbe54227356d5ab48623e435426ac7ff6e54d21b9fee4cc73e3f4bc7ef646d3e4ab1970e524c890cd1f735905 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +4556ead97907ec76aaa7dde450e4b6068f87268c49168eeb2af0c3df1dfa312b0a4a947b65b11fd413dae9af0beb3ef002d077c0d7f43b0bc466d3cd4348e657 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch +389eacbeba976a461af3d087d732d1c4f2a38bc5db91b935149e60ad4b210286ba76688b8a947d00f324566b6789152bf3b93a188fa2fb7ee8042786df483fed 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " diff --git a/cross/gcc-riscv64/0001-posix_memalign.patch b/cross/gcc-riscv64/0001-posix_memalign.patch index 04240c29c..bbc2db9ca 100644 --- a/cross/gcc-riscv64/0001-posix_memalign.patch +++ b/cross/gcc-riscv64/0001-posix_memalign.patch @@ -1,14 +1,14 @@ -From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001 +From 94cf7d2b3514ed3a4401861a519ead450e022afc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/35] posix_memalign +Subject: [PATCH] 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 3527283693b..c4071b64b53 100644 +index d1d79a32fc9..069c3bb8324 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ @@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644 else return NULL; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0002-gcc-poison-system-directories.patch b/cross/gcc-riscv64/0002-gcc-poison-system-directories.patch index 9a1671267..de66b72d0 100644 --- a/cross/gcc-riscv64/0002-gcc-poison-system-directories.patch +++ b/cross/gcc-riscv64/0002-gcc-poison-system-directories.patch @@ -1,7 +1,7 @@ -From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001 +From 0d5e04099a3d2609105719f7396a4ff941b873b6 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/35] gcc: poison-system-directories +Date: Thu, 23 Jan 2025 17:12:51 -0800 +Subject: [PATCH] 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 @@ -11,23 +11,25 @@ aborted. Instead, we add the two missing items to the current scan. If the user wants this to be a failure, they can add "-Werror=poison-system-directories". +Upstream-Status: Inappropriate [OE configuration] Signed-off-by: Mark Hatle +Signed-off-by: sunil dora Signed-off-by: Khem Raj - -Upstream-Status: Pending --- gcc/common.opt | 4 ++++ - gcc/config.in | 6 ++++++ - gcc/configure | 16 ++++++++++++++++ - gcc/configure.ac | 10 ++++++++++ + gcc/config.in | 10 ++++++++++ + gcc/configure | 19 +++++++++++++++++++ + gcc/configure.ac | 16 ++++++++++++++++ gcc/doc/invoke.texi | 9 +++++++++ - gcc/gcc.cc | 2 ++ - gcc/incpath.cc | 21 +++++++++++++++++++++ - 7 files changed, 68 insertions(+) + gcc/gcc.cc | 12 ++++++++++-- + gcc/incpath.cc | 25 +++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 2 deletions(-) +diff --git a/gcc/common.opt b/gcc/common.opt +index e3fa0dacec4..bea1adc0940 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -715,6 +715,10 @@ Wreturn-local-addr +@@ -729,6 +729,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. @@ -38,9 +40,11 @@ Upstream-Status: Pending Wshadow 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 a79c51adb2b..8a531ed591c 100644 --- a/gcc/config.in +++ b/gcc/config.in -@@ -249,6 +249,12 @@ +@@ -249,6 +249,16 @@ #endif @@ -48,14 +52,20 @@ Upstream-Status: Pending +#ifndef USED_FOR_TARGET +#undef ENABLE_POISON_SYSTEM_DIRECTORIES +#endif ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef POISON_BY_DEFAULT ++#endif + + /* Define if you want all operations on RTL (the basic data structure of the 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 16965953f05..0f4a5d52c30 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1050,6 +1050,7 @@ enable_maintainer_mode +@@ -1051,6 +1051,7 @@ enable_maintainer_mode enable_link_mutex enable_link_serialization enable_version_specific_runtime_libs @@ -63,7 +73,7 @@ Upstream-Status: Pending enable_plugin enable_host_shared enable_host_pie -@@ -1823,6 +1824,8 @@ Optional Features: +@@ -1828,6 +1829,8 @@ Optional Features: --enable-version-specific-runtime-libs specify that runtime libraries should be installed in a compiler-specific directory @@ -72,7 +82,7 @@ Upstream-Status: Pending --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE -@@ -34082,6 +34085,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -83,47 +93,60 @@ Upstream-Status: Pending + enable_poison_system_directories=no +fi + -+if test "x${enable_poison_system_directories}" = "xyes"; then ++if test "x${enable_poison_system_directories}" != "xno"; then + +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++if test "$enable_poison_system_directories" = "error"; then ++$as_echo "#define POISON_BY_DEFAULT 1" >>confdefs.h ++fi + +fi + # Substitute configuration variables +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 9f67e62950a..b0e3615e5aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7555,6 +7555,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) +AC_ARG_ENABLE([poison-system-directories], + AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system header directories]),, ++ [warn for use of native system header directories (no/yes/error)]),, + [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then ++AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories]) ++if test "x${enable_poison_system_directories}" != "xno"; then ++ AC_MSG_NOTICE([poisoned directories enabled]) + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], + [1], + [Define to warn for use of native system header directories]) ++ if test $enable_poison_system_directories = "error"; then ++ AC_MSG_NOTICE([poisoned directories are fatal]) ++ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors]) ++ fi +fi + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 72009c33cd0..29aea724731 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -405,6 +405,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 -@@ -8861,6 +8862,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. + -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor + -Wno-psabi + -Wredundant-decls -Wrestrict +@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default. + Suppress warnings from casts from a pointer to an integer type of a + different size. +@opindex Wno-poison-system-directories +@item -Wno-poison-system-directories @@ -133,12 +156,27 @@ Upstream-Status: Pending +directories contain the correct headers and libraries for the target +system rather than the host. + - @opindex Wfloat-equal - @opindex Wno-float-equal - @item -Wfloat-equal + @opindex Winvalid-pch + @opindex Wno-invalid-pch + @item -Winvalid-pch +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 4fd87f2c4a1..79d4920a047 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1163,6 +1163,8 @@ proper position among the other output files. */ +@@ -909,6 +909,12 @@ proper position among the other output files. */ + #define ASM_MAP "" + #endif + ++#ifdef POISON_BY_DEFAULT ++#define POISON_IS_ERROR " -Werror=poison-system-directories" ++#else ++#define POISON_IS_ERROR ++#endif ++ + /* Assembler options for compressed debug sections. */ + #if HAVE_LD_COMPRESS_DEBUG == 0 + /* Reject if the linker cannot write compressed debug sections. */ +@@ -1166,6 +1172,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}}} \ @@ -147,6 +185,26 @@ Upstream-Status: Pending %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +@@ -1268,7 +1276,7 @@ static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ + %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR; + + /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. + +@@ -1297,7 +1305,7 @@ static const char *cc1_options = + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +- %{pthread:-fprofile-update=prefer-atomic}}}"; ++ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR; + + static const char *asm_options = + "%{-target-help:%:print-asm-header()} " +diff --git a/gcc/incpath.cc b/gcc/incpath.cc +index c1bbfd3872a..2cdbebc4c50 100644 --- a/gcc/incpath.cc +++ b/gcc/incpath.cc @@ -26,6 +26,7 @@ @@ -157,9 +215,20 @@ Upstream-Status: Pending /* Microsoft Windows does not natively support inodes. VMS has non-numeric inodes. */ -@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) +@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + cur->name, xstrerror (errno)); + reason = REASON_NOENT; + } ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ pcur = &cur->next; ++ continue; ++#endif + } + else if (!S_ISDIR (st.st_mode)) + cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0, +@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + fprintf (stderr, _("End of #embed search list.\n")); } - fprintf (stderr, _("End of search list.\n")); } + +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES @@ -168,19 +237,22 @@ Upstream-Status: Pending + struct cpp_dir *p; + + for (p = heads[INC_QUOTE]; p; p = p->next) -+ { -+ if ((!strncmp (p->name, "/usr/include", 12)) -+ || (!strncmp (p->name, "/usr/local/include", 18)) -+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) -+ || (!strncmp (p->name, "/sw/include", 11)) -+ || (!strncmp (p->name, "/opt/include", 12))) -+ warning (OPT_Wpoison_system_directories, -+ "include location \"%s\" is unsafe for " -+ "cross-compilation", -+ p->name); -+ } ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } + } +#endif } /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0003-specs-turn-on-Wl-z-now-by-default.patch b/cross/gcc-riscv64/0003-specs-turn-on-Wl-z-now-by-default.patch index 33e8b56f1..be6a3dc60 100644 --- a/cross/gcc-riscv64/0003-specs-turn-on-Wl-z-now-by-default.patch +++ b/cross/gcc-riscv64/0003-specs-turn-on-Wl-z-now-by-default.patch @@ -1,7 +1,7 @@ -From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001 +From 90e8697dd88fd99ce2cf8739e95494853005377e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default +Subject: [PATCH] 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. @@ -13,9 +13,11 @@ now by default. gcc/gcc.cc | 1 + 2 files changed, 4 insertions(+) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 29aea724731..6fb3ab70cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -18935,6 +18935,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -19477,6 +19477,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}. @@ -25,9 +27,11 @@ now by default. @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 79d4920a047..74a356fdf5e 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1161,6 +1161,7 @@ proper position among the other output files. */ +@@ -1170,6 +1170,7 @@ proper position among the other output files. */ "%{flto|flto=*:% Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, - ObjC, ObjC++, if the optimization level is > 0 +Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, + ObjC++, if the optimization level is > 0 --- gcc/c-family/c-cppbuiltin.cc | 4 ++++ gcc/doc/invoke.texi | 6 ++++++ 2 files changed, 10 insertions(+) +diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc +index 4589ee4a3a6..9edf095384c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc -@@ -1570,6 +1570,10 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -1581,6 +1581,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); @@ -22,9 +24,11 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, /* Misc. */ if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 6fb3ab70cc7..799ce073dbf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -12496,6 +12496,12 @@ also turns on the following optimization flags: +@@ -12840,6 +12840,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. @@ -37,3 +41,6 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, @opindex O3 @item -O3 Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/cross/gcc-riscv64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 819ef5e76..deb4da3dc 100644 --- a/cross/gcc-riscv64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/cross/gcc-riscv64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,8 +1,8 @@ -From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001 +From a59da582e83071de0566274d912ca6f05f4b75d0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the - linker, but always link the sanitizer libraries with --no-as-needed. +Subject: [PATCH] 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 + @@ -21,9 +21,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the gcc/gcc.cc | 28 ++++++++++++++++++++-------- 14 files changed, 36 insertions(+), 19 deletions(-) +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index 116bb4e69f3..daf99f8dce9 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h -@@ -35,6 +35,7 @@ +@@ -39,6 +39,7 @@ #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ @@ -31,6 +33,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 3fd3b831166..0b4c2dccebe 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 @@ -42,6 +46,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{O*:-O3} %{!O*:-O1} \ %{shared:-shared} \ %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index d4d389e2aa8..adccc0b11c2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -52,6 +58,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 4c4e31efa39..3c17ac6eade 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 @@ -78,6 +86,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the #endif #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index 7abfda53049..ceb8f855b7d 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 @@ -89,6 +99,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index abe714711bf..3ca128a79f5 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 @@ -99,6 +111,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index a2494c214c4..e1a5d530cdf 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -110,6 +124,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5a82508c113..6eee7cdc603 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 @@ -120,6 +136,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 9060c940a44..282c77b6a7b 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see @@ -130,6 +148,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ -X \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 0316d8cb65d..139e1b6796c 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -378,13 +378,13 @@ extern int dot_symbols; @@ -148,6 +168,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!static-pie: \ %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ +diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h +index afb5c6ad867..b64638fb25b 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -159,6 +181,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 2c3bca5dfcb..b90661247a4 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 @@ -170,6 +194,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 6d928846895..3cc05bb7240 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); @@ -181,9 +207,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!static: \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 74a356fdf5e..fc9c7d15b04 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -771,8 +771,11 @@ proper position among the other output files. */ +@@ -774,8 +774,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -197,7 +225,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -807,8 +810,11 @@ proper position among the other output files. */ +@@ -810,8 +813,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -211,7 +239,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -825,8 +831,11 @@ proper position among the other output files. */ +@@ -828,8 +834,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +253,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -841,8 +850,11 @@ proper position among the other output files. */ +@@ -844,8 +853,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 @@ -239,3 +267,6 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0006-Enable-Wformat-and-Wformat-security-by-default.patch b/cross/gcc-riscv64/0006-Enable-Wformat-and-Wformat-security-by-default.patch index b4d580f85..b8851777b 100644 --- a/cross/gcc-riscv64/0006-Enable-Wformat-and-Wformat-security-by-default.patch +++ b/cross/gcc-riscv64/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -1,15 +1,17 @@ -From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001 +From 35c02ea8267e193b92f30495c94ee1e8e5c2be8e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH] 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 75b6531860e..78830ce4b42 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -774,7 +774,7 @@ Warn about function calls with format strings that write past the end +@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end of the destination region. Wformat-security @@ -18,7 +20,7 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -799,7 +799,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -27,3 +29,6 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about printf/scanf/strftime/strfmon format string anomalies. Wframe-address +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-riscv64/0007-Enable-Wtrampolines-by-default.patch index 140685d7b..eda9ab096 100644 --- a/cross/gcc-riscv64/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-riscv64/0007-Enable-Wtrampolines-by-default.patch @@ -1,16 +1,18 @@ -From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/35] Enable -Wtrampolines by default. +From 0b82663fd2f054e07e116c4dcc5019f7e969cd3e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:44:20 -0700 +Subject: [PATCH] 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 bea1adc0940..e65a575d9f8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -811,7 +811,7 @@ Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers. +@@ -829,7 +829,7 @@ Common Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wa + Warn if a comparison always evaluates to true or false. Wtrampolines -Common Var(warn_trampolines) Warning @@ -18,3 +20,6 @@ Subject: [PATCH 07/35] Enable -Wtrampolines by default. Warn whenever a trampoline is generated. Wtrivial-auto-var-init +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/cross/gcc-riscv64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch deleted file mode 100644 index e85284ff0..000000000 --- a/cross/gcc-riscv64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and - -ffreestanding Change the buffer size. - ---- - gcc/gcc.cc | 8 +++++++- - gcc/params.opt | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1000,6 +1000,12 @@ proper position among the other output files. */ - #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" - #endif - -+#ifdef ENABLE_DEFAULT_SSP -+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " -+#else -+#define NO_SSP_SPEC "" -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1305,7 +1311,7 @@ static const char *cc1_options = - %{-version:--version}\ - %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ -- %{fsyntax-only:-o %j} %{-param*}\ -+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ - %{coverage:-fprofile-arcs -ftest-coverage}\ - %{fprofile-arcs|fcondition-coverage|fprofile-generate*|coverage:\ - %{!fprofile-update=single:\ ---- a/gcc/params.opt -+++ b/gcc/params.opt -@@ -1013,7 +1013,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim - The maximum number of SSA_NAME assignments to follow in determining a value. - - -param=ssp-buffer-size= --Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization -+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization - The lower bound for a buffer to be considered for stack smashing protection. - - -param=stack-clash-protection-guard-size= diff --git a/cross/gcc-riscv64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch b/cross/gcc-riscv64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch new file mode 100644 index 000000000..8997916ca --- /dev/null +++ b/cross/gcc-riscv64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch @@ -0,0 +1,39 @@ +From 3acf32fc94fd447874b2f1447a19a65f0905bff5 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:49:03 -0700 +Subject: [PATCH] gcc: disable SSP on -ffreestanding, -nostdlib and + -nodefaultlibs + +--- + gcc/gcc.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9c7d15b04..7b0d3d2743b 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1009,6 +1009,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1314,7 +1320,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch b/cross/gcc-riscv64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch new file mode 100644 index 000000000..8b25ba72d --- /dev/null +++ b/cross/gcc-riscv64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch @@ -0,0 +1,25 @@ +From bb98973bdb5fe8bd040e238afe92845203929b59 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:50:42 -0700 +Subject: [PATCH] gcc: params: set default ssp-buffer-size to 4 + +--- + gcc/params.opt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/params.opt b/gcc/params.opt +index 64e453d29b7..bba3fd574f2 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -1064,7 +1064,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.50.1 + diff --git a/cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-riscv64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch similarity index 88% rename from cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch rename to cross/gcc-riscv64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index f4dd52f19..c903a5cce 100644 --- a/cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-riscv64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,8 +1,8 @@ -From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001 +From f89d8e95b809d02eceee416b463200c9abb2b33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during - gcc bootstrapping. +Subject: [PATCH] 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 12d34910830..61b13762b71 100644 +index 7f84a99533e..a4c6284f788 100644 --- a/libstdc++-v3/po/Makefile.am +++ b/libstdc++-v3/po/Makefile.am @@ -38,6 +38,7 @@ MSGFMT = msgfmt @@ -50,5 +50,5 @@ index 8e93445acd2..d6ff06e5ddb 100644 all-local: all-local-$(USE_NLS) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-riscv64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch similarity index 73% rename from cross/gcc-riscv64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch rename to cross/gcc-riscv64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch index f56d41a57..48b22a5dc 100644 --- a/cross/gcc-riscv64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-riscv64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,17 +1,17 @@ -From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001 +From b45303198567828a5240baf932a8c13255f35d20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/35] Don't declare asprintf if defined as a macro. +Subject: [PATCH] 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 1d5c779fcff..19e3cb1e31c 100644 +index d4e8791b14b..c074980ed80 100644 --- a/include/libiberty.h +++ b/include/libiberty.h -@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *, +@@ -678,8 +678,11 @@ extern void *bsearch_r (const void *, const void *, /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. */ @@ -24,5 +24,5 @@ index 1d5c779fcff..19e3cb1e31c 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-riscv64/0012-libiberty-copy-PIC-objects-during-build-process.patch similarity index 66% rename from cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch rename to cross/gcc-riscv64/0012-libiberty-copy-PIC-objects-during-build-process.patch index b12d4f94b..ff49be1c6 100644 --- a/cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-riscv64/0012-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,17 +1,17 @@ -From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001 +From 68e2c9356221ba30b27840b9449f742505584cf1 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/35] libiberty: copy PIC objects during build process +Subject: [PATCH] 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 72608f3e4a7..58356884728 100644 +index ce54d88278d..10c212a1ad3 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) +@@ -266,6 +266,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ @@ -20,5 +20,5 @@ index 72608f3e4a7..58356884728 100644 else true; fi -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0012-libgcc_s.patch b/cross/gcc-riscv64/0013-libgcc_s.patch similarity index 76% rename from cross/gcc-riscv64/0012-libgcc_s.patch rename to cross/gcc-riscv64/0013-libgcc_s.patch index 8189f8491..99152585f 100644 --- a/cross/gcc-riscv64/0012-libgcc_s.patch +++ b/cross/gcc-riscv64/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001 +From ca482f8c9cac9617855f908dd30d3d6144e850a0 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 12/35] libgcc_s +Subject: [PATCH] libgcc_s --- gcc/config/i386/i386-expand.cc | 4 ++-- @@ -9,9 +9,11 @@ Subject: [PATCH 12/35] libgcc_s libgcc/config/i386/t-linux | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) +diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc +index cdfd94d3c73..a3a6c988833 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc -@@ -13089,10 +13089,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -13643,10 +13643,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -24,6 +26,8 @@ Subject: [PATCH 12/35] libgcc_s call_expr = build_call_expr (fndecl, 0); return expand_expr (call_expr, target, mode, EXPAND_NORMAL); } +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index 2484dc839bf..e980030ef23 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -63,7 +63,7 @@ __cpu_indicator_init (void) @@ -37,6 +41,8 @@ Subject: [PATCH 12/35] libgcc_s +int __cpu_indicator_init_local (void) + __attribute__ ((weak, alias ("__cpu_indicator_init"))); #endif +diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux +index 8506a635790..564296f788e 100644 --- a/libgcc/config/i386/t-linux +++ b/libgcc/config/i386/t-linux @@ -3,5 +3,5 @@ @@ -46,3 +52,6 @@ Subject: [PATCH 12/35] libgcc_s -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.50.1 + diff --git a/cross/gcc-aarch64/0013-nopie.patch b/cross/gcc-riscv64/0014-nopie.patch similarity index 79% rename from cross/gcc-aarch64/0013-nopie.patch rename to cross/gcc-riscv64/0014-nopie.patch index 4a9ea0770..7117a9434 100644 --- a/cross/gcc-aarch64/0013-nopie.patch +++ b/cross/gcc-riscv64/0014-nopie.patch @@ -1,16 +1,18 @@ -From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001 +From 6dfb241ae9f879f4945941273dd73eb13f127b06 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 13/35] nopie +Subject: [PATCH] nopie --- gcc/configure | 25 +++++++++++++++++++++++++ gcc/configure.ac | 11 +++++++++++ 2 files changed, 36 insertions(+) +diff --git a/gcc/configure b/gcc/configure +index 0f4a5d52c30..343563c8948 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \ +@@ -34586,6 +34586,29 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 $as_echo "$gcc_cv_no_pie" >&6; } @@ -40,7 +42,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then +@@ -34603,6 +34626,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -49,9 +51,11 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b0e3615e5aa..b3948469d17 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -7802,6 +7802,15 @@ AC_CACHE_CHECK([for -no-pie option], [gcc_cv_no_pie=yes], [gcc_cv_no_pie=no]) LDFLAGS="$saved_LDFLAGS"]) @@ -67,7 +71,7 @@ Subject: [PATCH 13/35] nopie if test x$enable_host_shared = xyes; then PICFLAG=-fPIC -@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then +@@ -7819,6 +7828,8 @@ if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then LD_PICFLAG=-no-pie @@ -76,3 +80,6 @@ Subject: [PATCH 13/35] nopie else LD_PICFLAG= fi +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0014-ada-fix-shared-linking.patch b/cross/gcc-riscv64/0015-ada-fix-shared-linking.patch similarity index 90% rename from cross/gcc-aarch64/0014-ada-fix-shared-linking.patch rename to cross/gcc-riscv64/0015-ada-fix-shared-linking.patch index ff6e42921..a893502b7 100644 --- a/cross/gcc-aarch64/0014-ada-fix-shared-linking.patch +++ b/cross/gcc-riscv64/0015-ada-fix-shared-linking.patch @@ -1,14 +1,14 @@ -From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001 +From 8ac6aeca5d6192ee16b959bd8c1903a52d408a55 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 14/35] ada: fix shared linking +Subject: [PATCH] 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 f2126441208..22cfa9c641f 100644 +index 9e3385ca94f..2c0cca6e480 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; @@ -38,5 +38,5 @@ index f2126441208..22cfa9c641f 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-riscv64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch similarity index 70% rename from cross/gcc-riscv64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch rename to cross/gcc-riscv64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index ddea4a05b..a6adebb1f 100644 --- a/cross/gcc-riscv64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-riscv64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,12 +1,14 @@ -From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001 +From 7323d68ae46fc8e33c0746799d820a4e4c8c8b72 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + 1 file changed, 1 insertion(+) +diff --git a/Makefile.in b/Makefile.in +index b1ed67d3d4f..1e039c20550 100644 --- a/Makefile.in +++ b/Makefile.in @@ -179,6 +179,7 @@ BUILD_EXPORTS = \ @@ -17,3 +19,6 @@ Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing LDFLAGS="$(LDFLAGS_FOR_BUILD)" # This is the list of directories to built for the host system. +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0016-add-fortify-headers-paths.patch b/cross/gcc-riscv64/0017-add-fortify-headers-paths.patch similarity index 80% rename from cross/gcc-riscv64/0016-add-fortify-headers-paths.patch rename to cross/gcc-riscv64/0017-add-fortify-headers-paths.patch index b554e0251..b4ecd2fd5 100644 --- a/cross/gcc-riscv64/0016-add-fortify-headers-paths.patch +++ b/cross/gcc-riscv64/0017-add-fortify-headers-paths.patch @@ -1,14 +1,14 @@ -From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001 +From eaf89c8c91806905c6e1ec9519cbfb56296204b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 16/35] add fortify-headers paths +Subject: [PATCH] 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 e3aca79cccc..b3537b8fbeb 100644 +index d6280a4d4dd..ba69fb9fad7 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -159,6 +159,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -21,5 +21,5 @@ index e3aca79cccc..b3537b8fbeb 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-riscv64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch similarity index 68% rename from cross/gcc-armhf/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch rename to cross/gcc-riscv64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index 4796a055d..84731bb57 100644 --- a/cross/gcc-armhf/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-riscv64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,9 +1,9 @@ -From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001 +From bdedcd9db7b8291637c5147dd82e8a9e3f5f9c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 21 Aug 2020 07:03:00 +0000 -Subject: [PATCH 17/35] 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] 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. @@ -12,9 +12,11 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We gcc/gcc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 7b0d3d2743b..e46e976a2e8 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1008,8 +1008,7 @@ proper position among the other output files. */ +@@ -1017,8 +1017,7 @@ proper position among the other output files. */ #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP @@ -24,3 +26,6 @@ Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.50.1 + diff --git a/cross/gcc-armhf/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-riscv64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch similarity index 84% rename from cross/gcc-armhf/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch rename to cross/gcc-riscv64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index b829e5b34..b703be7a7 100644 --- a/cross/gcc-armhf/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-riscv64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,16 +1,18 @@ -From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001 +From 586ce3614d4fc3fbeccf01659114a4643c1879c8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- gcc/gcc.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e46e976a2e8..607c8ca1d42 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -772,10 +772,10 @@ proper position among the other output files. */ +@@ -775,10 +775,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 "}" \ @@ -23,7 +25,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -811,10 +811,10 @@ proper position among the other output files. */ +@@ -814,10 +814,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 "}" \ @@ -36,7 +38,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -832,10 +832,10 @@ proper position among the other output files. */ +@@ -835,10 +835,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 "}" \ @@ -49,7 +51,7 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -851,10 +851,10 @@ proper position among the other output files. */ +@@ -854,10 +854,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 "}" \ @@ -62,3 +64,6 @@ Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-armhf/0019-aarch64-disable-multilib-support.patch b/cross/gcc-riscv64/0020-aarch64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-armhf/0019-aarch64-disable-multilib-support.patch rename to cross/gcc-riscv64/0020-aarch64-disable-multilib-support.patch index 5a8148feb..f2ad4bd64 100644 --- a/cross/gcc-armhf/0019-aarch64-disable-multilib-support.patch +++ b/cross/gcc-riscv64/0020-aarch64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001 +From 0ca7f92018d0bc04a72655f3b130c9aaeea1b771 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:12:55 +0000 -Subject: [PATCH 19/35] aarch64: disable multilib support +Subject: [PATCH] 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 57bf4100fcd..172894b57ef 100644 +index 70e36b3299e..e00c3becd3f 100644 --- a/gcc/config/aarch64/t-aarch64-linux +++ b/gcc/config/aarch64/t-aarch64-linux @@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm @@ -22,5 +22,5 @@ index 57bf4100fcd..172894b57ef 100644 MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0020-s390x-disable-multilib-support.patch b/cross/gcc-riscv64/0021-s390x-disable-multilib-support.patch similarity index 85% rename from cross/gcc-riscv64/0020-s390x-disable-multilib-support.patch rename to cross/gcc-riscv64/0021-s390x-disable-multilib-support.patch index ef2f449a4..7b71aa3bc 100644 --- a/cross/gcc-riscv64/0020-s390x-disable-multilib-support.patch +++ b/cross/gcc-riscv64/0021-s390x-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001 +From b48898c8fbd7828b81f407c74c25cf8e07fb73a4 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:13:59 +0000 -Subject: [PATCH 20/35] s390x: disable multilib support +Subject: [PATCH] s390x: disable multilib support multilib is not supported on Alpine GCC at present --- @@ -21,5 +21,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.41.0 +2.50.1 diff --git a/cross/gcc-aarch64/0021-ppc64-le-disable-multilib-support.patch b/cross/gcc-riscv64/0022-ppc64-le-disable-multilib-support.patch similarity index 95% rename from cross/gcc-aarch64/0021-ppc64-le-disable-multilib-support.patch rename to cross/gcc-riscv64/0022-ppc64-le-disable-multilib-support.patch index dbdc78828..5281a006c 100644 --- a/cross/gcc-aarch64/0021-ppc64-le-disable-multilib-support.patch +++ b/cross/gcc-riscv64/0022-ppc64-le-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001 +From 158d93ce86f3d311ce489d0740326027068ca721 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:33 +0000 -Subject: [PATCH 21/35] ppc64[le]: disable multilib support +Subject: [PATCH] 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 01a94242308..b3a76379c03 100644 +index f56b47c268e..c5f757a6284 100644 --- a/gcc/config/rs6000/t-linux64 +++ b/gcc/config/rs6000/t-linux64 @@ -28,8 +28,8 @@ @@ -77,5 +77,5 @@ index 2e63bdb9fc9..c6e1c5db65d 100644 +MULTILIB_OSDIRNAMES += m32=../lib32 MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0022-x86_64-disable-multilib-support.patch b/cross/gcc-riscv64/0023-x86_64-disable-multilib-support.patch similarity index 84% rename from cross/gcc-armhf/0022-x86_64-disable-multilib-support.patch rename to cross/gcc-riscv64/0023-x86_64-disable-multilib-support.patch index 2b2f3e7f3..1e74e9462 100644 --- a/cross/gcc-armhf/0022-x86_64-disable-multilib-support.patch +++ b/cross/gcc-riscv64/0023-x86_64-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001 +From 6957fc21caca80f5e01db15df6dc8de46c85167b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 6 Jan 2022 03:14:54 +0000 -Subject: [PATCH 22/35] x86_64: disable multilib support +Subject: [PATCH] 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 138956b0962..bc03dab874f 100644 +index 64a4a20e64f..9a8eb8dd8d1 100644 --- a/gcc/config/i386/t-linux64 +++ b/gcc/config/i386/t-linux64 @@ -33,6 +33,6 @@ @@ -22,5 +22,5 @@ index 138956b0962..bc03dab874f 100644 +MULTILIB_OSDIRNAMES+= m32=../lib32 MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0023-riscv-disable-multilib-support.patch b/cross/gcc-riscv64/0024-riscv-disable-multilib-support.patch similarity index 90% rename from cross/gcc-riscv64/0023-riscv-disable-multilib-support.patch rename to cross/gcc-riscv64/0024-riscv-disable-multilib-support.patch index eb9ba90fc..cc136a04f 100644 --- a/cross/gcc-riscv64/0023-riscv-disable-multilib-support.patch +++ b/cross/gcc-riscv64/0024-riscv-disable-multilib-support.patch @@ -1,7 +1,7 @@ -From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001 +From fdcbe7ee4ce81cdf247966385c8d521ac3f5a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 3 Jan 2022 07:14:48 +0100 -Subject: [PATCH 23/35] riscv: disable multilib support +Subject: [PATCH] riscv: disable multilib support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -42,6 +42,8 @@ library. gcc/config/riscv/t-linux | 7 +++++-- 2 files changed, 5 insertions(+), 10 deletions(-) +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 282c77b6a7b..07adae3d59c 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see @@ -56,6 +58,8 @@ library. - "/usr/lib/ " - -#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi +diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux +index a6f64f88d25..f88776ec520 100644 --- a/gcc/config/riscv/t-linux +++ b/gcc/config/riscv/t-linux @@ -1,5 +1,8 @@ @@ -69,3 +73,6 @@ library. +MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0025-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-riscv64/0025-ada-libgnarl-compatibility-for-musl.patch deleted file mode 100644 index b7c1c5f2f..000000000 --- a/cross/gcc-riscv64/0025-ada-libgnarl-compatibility-for-musl.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 25/35] ada: libgnarl compatibility for musl - ---- - gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ - gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- - 2 files changed, 3 insertions(+), 61 deletions(-) - -diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads -index 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 - PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; - -- function pthread_rwlockattr_setkind_np -- (attr : access pthread_rwlockattr_t; -- pref : int) return int; -- pragma Import -- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); -- - function pthread_rwlock_init - (mutex : access pthread_rwlock_t; - attr : access pthread_rwlockattr_t) return int; -@@ -470,11 +464,6 @@ package System.OS_Interface is - protocol : int) return int; - pragma Import (C, pthread_mutexattr_setprotocol); - -- function pthread_mutexattr_setprioceiling -- (attr : access pthread_mutexattr_t; -- prioceiling : int) return int; -- pragma Import (C, pthread_mutexattr_setprioceiling); -- - type struct_sched_param is record - 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 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 - pragma Import - (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); - -- function GNAT_has_cap_sys_nice return C.int; -- pragma Import -- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); - -- We do not have pragma Linker_Options ("-lcap"); here, because this - -- library is not present on many Linux systems. 'libcap' is the Linux - -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is - -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on - -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. - -- function Get_Ceiling_Support return Boolean; -- -- Get the value of the Ceiling_Support constant (see below). -- -- Note well: If this function or related code is modified, it should be -- -- tested by hand, because automated testing doesn't exercise it. -- -- ------------------------- -- -- Get_Ceiling_Support -- -- ------------------------- -- -- function Get_Ceiling_Support return Boolean is -- Ceiling_Support : Boolean := False; -- begin -- if Locking_Policy /= 'C' then -- return False; -- end if; -- -- declare -- function geteuid return Integer; -- pragma Import (C, geteuid, "geteuid"); -- Superuser : constant Boolean := geteuid = 0; -- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; -- pragma Assert (Has_Cap in 0 | 1); -- begin -- Ceiling_Support := Superuser or else Has_Cap = 1; -- end; -- -- return Ceiling_Support; -- end Get_Ceiling_Support; -- -- pragma Warnings (Off, "non-preelaborable call not allowed*"); -- Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-preelaborable call not allowed*"); - -- True if the locking policy is Ceiling_Locking, and the current process - -- has permission to use this policy. The process has permission if it is - -- running as 'root', or if the capability was set by the setcap command, -@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is - -- Init_Mutex -- - ---------------- - -+ pragma Warnings (Off, "formal parameter * is not referenced"); - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is -+ pragma Warnings (On, "formal parameter * is not referenced"); - Mutex_Attr : aliased pthread_mutexattr_t; - Result, Result_2 : C.int; - -@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is - return Result; - end if; - -- if Ceiling_Support then -- Result := pthread_mutexattr_setprotocol -- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); -- pragma Assert (Result = 0); -- -- Result := pthread_mutexattr_setprioceiling -- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); -- pragma Assert (Result = 0); -- -- elsif Locking_Policy = 'I' then -+ if Locking_Policy = 'I' then - Result := pthread_mutexattr_setprotocol - (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); - pragma Assert (Result = 0); -@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is - Result := pthread_rwlockattr_init (RWlock_Attr'Access); - pragma Assert (Result = 0); - -- Result := pthread_rwlockattr_setkind_np -- (RWlock_Attr'Access, -- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); -- pragma Assert (Result = 0); -- - Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); - - pragma Assert (Result in 0 | ENOMEM); --- -2.41.0 - diff --git a/cross/gcc-riscv64/0024-always-build-libgcc_eh.a.patch b/cross/gcc-riscv64/0025-always-build-libgcc_eh.a.patch similarity index 78% rename from cross/gcc-riscv64/0024-always-build-libgcc_eh.a.patch rename to cross/gcc-riscv64/0025-always-build-libgcc_eh.a.patch index 5d508ea08..5b21d4dd1 100644 --- a/cross/gcc-riscv64/0024-always-build-libgcc_eh.a.patch +++ b/cross/gcc-riscv64/0025-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001 +From 6f63901256443978a2c3746e72bd5762166a7790 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 24/35] always build libgcc_eh.a +Subject: [PATCH] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -9,9 +9,11 @@ highly inspired by: libgcc/Makefile.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index 0719fd0615d..80bb8f1622f 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -967,8 +967,9 @@ ifneq ($(LIBUNWIND),) +@@ -971,8 +971,9 @@ ifneq ($(LIBUNWIND),) all: libunwind.a endif @@ -22,7 +24,7 @@ highly inspired by: ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1173,10 +1174,6 @@ install-libunwind: +@@ -1177,10 +1178,6 @@ install-libunwind: install-shared: $(mkinstalldirs) $(DESTDIR)$(inst_libdir) @@ -33,7 +35,7 @@ highly inspired by: $(subst @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_base_name@,libgcc_s,$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -1193,6 +1190,10 @@ ifeq ($(enable_gcov),yes) +@@ -1197,6 +1194,10 @@ ifeq ($(enable_gcov),yes) $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a endif @@ -44,3 +46,6 @@ highly inspired by: parts="$(INSTALL_PARTS)"; \ for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch b/cross/gcc-riscv64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch new file mode 100644 index 000000000..e8fb24481 --- /dev/null +++ b/cross/gcc-riscv64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch @@ -0,0 +1,59 @@ +From a365def37f5de93ad85588d8e2c02c0df28e88d6 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:09:02 -0700 +Subject: [PATCH] ada: libgnarl: remove use of glibc-specific + pthread_rwlockattr_setkind_np + +musl's thread library does not implement it + +Signed-off-by: Ariadne Conill +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 10 ---------- + gcc/ada/libgnarl/s-taprop__linux.adb | 7 ------- + 2 files changed, 17 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 7aeb15da523..5551b701e5a 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -402,16 +402,6 @@ package System.OS_Interface is + (attr : access pthread_rwlockattr_t) return int; + pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy"); + +- PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0; +- PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; +- +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb +index 8f4c835baa7..6df36c7d8f4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -409,16 +409,9 @@ package body System.Task_Primitives.Operations is + Result : C.int; + + begin +- -- Set the rwlock to prefer writer to avoid writers starvation +- + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0026-ada-musl-support-fixes.patch b/cross/gcc-riscv64/0026-ada-musl-support-fixes.patch deleted file mode 100644 index 0be683fa6..000000000 --- a/cross/gcc-riscv64/0026-ada-musl-support-fixes.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 26/35] ada: musl support fixes - ---- - gcc/ada/Makefile.rtl | 16 ++++++++-------- - gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- - gcc/ada/adaint.h | 10 ++++------ - gcc/ada/terminals.c | 8 ++++---- - 4 files changed, 35 insertions(+), 33 deletions(-) - ---- a/gcc/ada/Makefile.rtl -+++ b/gcc/ada/Makefile.rtl -@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) - s-intman.adb - #include - #endif -+ -+#if defined (linux) || defined(__linux__) -+#define _GNU_SOURCE 1 -+#include -+#endif - - #ifdef __PikeOS__ - #define __BSD_VISIBLE 1 -@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void) - #endif - - #if defined (__linux__) --#include - - /* glibc versions earlier than 2.7 do not define the routines to handle - dynamically allocated CPU sets. For these targets, we use the static -@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void) - - /* Dynamic cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count) - { - return CPU_ALLOC (count); -@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { -- CPU_FREE (set); -+ CPU_FREE ((cpu_set_t *) set); - } - - void --__gnat_cpu_zero (size_t count, cpu_set_t *set) -+__gnat_cpu_zero (size_t count, void *set) - { -- CPU_ZERO_S (count, set); -+ CPU_ZERO_S (count, (cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET_S (cpu - 1, count, set); -+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); - } - - #else /* !CPU_ALLOC */ - - /* Static cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) - { -- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); -+ return xmalloc (sizeof (cpu_set_t)); - } - - size_t -@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { - free (set); - } - - void --__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) - { -- CPU_ZERO (set); -+ CPU_ZERO ((cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET (cpu - 1, set); -+ CPU_SET (cpu - 1, (cpu_set_t *) set); - } - #endif /* !CPU_ALLOC */ - #endif /* __linux__ */ ---- a/gcc/ada/adaint.h -+++ b/gcc/ada/adaint.h -@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void); - - /* Routines for interface to required CPU set primitives */ - --#include -- --extern cpu_set_t *__gnat_cpu_alloc (size_t); -+extern void * __gnat_cpu_alloc (size_t); - extern size_t __gnat_cpu_alloc_size (size_t); --extern void __gnat_cpu_free (cpu_set_t *); --extern void __gnat_cpu_zero (size_t, cpu_set_t *); --extern void __gnat_cpu_set (int, size_t, cpu_set_t *); -+extern void __gnat_cpu_free (void *); -+extern void __gnat_cpu_zero (size_t, void *); -+extern void __gnat_cpu_set (int, size_t, void *); - #endif - - #if defined (_WIN32) ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1134,7 +1134,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) -- 2- getpt (USE_GETPT) -+ 2- posix_openpt (USE_POSIX_OPENPT) - 3- openpty (USE_OPENPTY) - - When using the cloning device method, the macro USE_CLONE_DEVICE should -@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, - #if defined (__APPLE__) || defined (BSD) - #define USE_OPENPTY - #elif defined (__linux__) --#define USE_GETPT -+#define USE_POSIX_OPENPT - #elif defined (__sun__) - #define USE_CLONE_DEVICE "/dev/ptmx" - #elif defined (_AIX) -@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { - int master_fd = -1; - char *slave_name = NULL; - --#ifdef USE_GETPT -- master_fd = getpt (); -+#if defined(USE_POSIX_OPENPT) -+ master_fd = posix_openpt(O_RDWR | O_NOCTTY); - #elif defined (USE_OPENPTY) - status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); - #elif defined (USE_CLONE_DEVICE) diff --git a/cross/gcc-riscv64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch b/cross/gcc-riscv64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch new file mode 100644 index 000000000..c138a6034 --- /dev/null +++ b/cross/gcc-riscv64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch @@ -0,0 +1,50 @@ +From e1572457f94a26da9a588a36afa3eb0e74122c34 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:13:19 -0700 +Subject: [PATCH] ada: libgnarl: use posix_openpt instead of glibc-specific + getpt to open a pty + +musl only implements posix_openpt(3), not the older glibc-specific getpt() +and glibc implements both for ages. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/terminals.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index 89f887556c0..93557fe2631 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1134,7 +1134,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) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + #if defined (__APPLE__) || defined (BSD) + #define USE_OPENPTY + #elif defined (__linux__) +-#define USE_GETPT ++#define USE_POSIX_OPENPT + #elif defined (__sun__) + #define USE_CLONE_DEVICE "/dev/ptmx" + #elif defined (_AIX) +@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch b/cross/gcc-riscv64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch new file mode 100644 index 000000000..0bf61bd9f --- /dev/null +++ b/cross/gcc-riscv64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch @@ -0,0 +1,54 @@ +From 4f26d4bfedb7f942b69ca4743f053c3a690a0b4a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:18:49 -0700 +Subject: [PATCH] ada: libgnarl: adaint: fix sched.h inclusion for musl + +Signed-off-by: Ariadne Conill +--- + gcc/ada/adaint.c | 6 +++++- + gcc/ada/adaint.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 1fcfae165a7..67318e647ed 100644 +--- a/gcc/ada/adaint.c ++++ b/gcc/ada/adaint.c +@@ -95,6 +95,11 @@ + #include + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 + #endif +@@ -3476,7 +3481,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 3df12b5f956..26a489f2b78 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -40,6 +40,11 @@ extern "C" { + #include "mingw32.h" + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #include + + /* Constants used for the form parameter encoding values */ +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-riscv64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch similarity index 86% rename from cross/gcc-riscv64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch rename to cross/gcc-riscv64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch index 0b92854c4..32c8c8724 100644 --- a/cross/gcc-riscv64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +++ b/cross/gcc-riscv64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch @@ -1,14 +1,14 @@ -From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001 +From 6592e702844d31bcef17c340bfc13e0e1be9f132 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 9 Dec 2020 07:42:06 +0000 -Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in +Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in LINK_GCC_C_SEQUENCE_SPEC [PR81358] This fixes issues with RISC-V. --- Makefile.in | 1 + - gcc/config/gnu-user.h | 12 +++++++++++- gcc/config.in | 6 ++++++ + gcc/config/gnu-user.h | 12 +++++++++++- gcc/configure | 31 ++++++++++++++++++++++++++++++- gcc/configure.ac | 21 +++++++++++++++++++++ gcc/doc/install.texi | 8 ++++++++ @@ -17,9 +17,11 @@ This fixes issues with RISC-V. gcc/gcc.cc | 12 +++++++++++- 9 files changed, 102 insertions(+), 5 deletions(-) +diff --git a/Makefile.in b/Makefile.in +index 1e039c20550..20f535a306a 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -237,6 +237,7 @@ HOST_EXPORTS = \ +@@ -238,6 +238,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; \ @@ -27,6 +29,25 @@ This fixes issues with RISC-V. HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ +diff --git a/gcc/config.in b/gcc/config.in +index 8a531ed591c..40045ff35a5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -131,6 +131,12 @@ + #endif + + ++/* Define if libatomic should always be linked. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_AUTOLINK_LIBATOMIC ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 3c17ac6eade..0426efdb8c3 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 @@ -49,24 +70,11 @@ This fixes issues with RISC-V. %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" #undef LINK_GCC_C_SEQUENCE_SPEC ---- a/gcc/config.in -+++ b/gcc/config.in -@@ -131,6 +131,12 @@ - #endif - - -+/* Define if libatomic should always be linked. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_AUTOLINK_LIBATOMIC -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET +diff --git a/gcc/configure b/gcc/configure +index 343563c8948..54300a2a867 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1002,6 +1002,7 @@ with_changes_root_url +@@ -1003,6 +1003,7 @@ with_changes_root_url enable_languages with_multilib_list with_multilib_generator @@ -74,7 +82,7 @@ This fixes issues with RISC-V. with_zstd with_zstd_include with_zstd_lib -@@ -1739,6 +1740,9 @@ Optional Features: +@@ -1742,6 +1743,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 @@ -84,7 +92,7 @@ This fixes issues with RISC-V. --disable-rpath do not hardcode runtime library paths --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling -@@ -8380,7 +8384,6 @@ else +@@ -8400,7 +8404,6 @@ else fi @@ -92,7 +100,7 @@ This fixes issues with RISC-V. # Check whether --with-multilib-generator was given. if test "${with_multilib_generator+set}" = set; then : withval=$with_multilib_generator; : -@@ -8388,6 +8391,32 @@ else +@@ -8408,6 +8411,32 @@ else with_multilib_generator=default fi @@ -125,9 +133,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b3948469d17..81c070830e2 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -1215,6 +1215,27 @@ AC_ARG_WITH(multilib-generator, +@@ -1227,6 +1227,27 @@ AC_ARG_WITH(multilib-generator, :, with_multilib_generator=default) @@ -155,9 +165,11 @@ This fixes issues with RISC-V. # ------------------------- # Checks for other programs # ------------------------- +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 3e9e09b4ae3..6e7b756be61 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi -@@ -2525,6 +2525,14 @@ files, but these changed header paths may conflict with some compilation +@@ -2617,6 +2617,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}. @@ -172,6 +184,8 @@ This fixes issues with RISC-V. @item --with-glibc-version=@var{major}.@var{minor} 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 a96700c0d38..16deedca64d 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -189,6 +203,8 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in +index eccc4d88493..4ca4c610571 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. @@ -206,9 +222,11 @@ This fixes issues with RISC-V. @end defmac @defmac POST_LINK_SPEC +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 607c8ca1d42..e9f78f0f4c1 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -991,13 +991,23 @@ proper position among the other output files. */ +@@ -1000,13 +1000,23 @@ proper position among the other output files. */ # define ASM_DEBUG_OPTION_SPEC "" #endif @@ -233,3 +251,6 @@ This fixes issues with RISC-V. #endif #ifdef ENABLE_DEFAULT_SSP +-- +2.50.1 + diff --git a/cross/gcc-aarch64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-riscv64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch similarity index 90% rename from cross/gcc-aarch64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch rename to cross/gcc-riscv64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch index f92fc7bf4..5aed9caf5 100644 --- a/cross/gcc-aarch64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch +++ b/cross/gcc-riscv64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -1,8 +1,8 @@ -From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 +From 952070c1616f231a810af2da50264713d7587b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 29 Aug 2021 12:23:34 +0200 -Subject: [PATCH 28/35] configure: fix detection of atomic builtins in - libatomic configure script +Subject: [PATCH] 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 a92ae9e8309..90b579ca4d8 100644 +index 6db039d6e8b..2751b5c1387 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -30,6 +30,26 @@ @@ -53,5 +53,5 @@ index a92ae9e8309..90b579ca4d8 100644 alpha*) # fenv.c needs this option to generate inexact exceptions. -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-riscv64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch similarity index 78% rename from cross/gcc-armhf/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch rename to cross/gcc-riscv64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch index 4418cd5b5..2b7259a4d 100644 --- a/cross/gcc-armhf/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +++ b/cross/gcc-riscv64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch @@ -1,15 +1,15 @@ -From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001 +From 896b002a2afacb4d75d573aca4ae53b499df19cd Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 30 Jun 2022 16:44:51 +0000 -Subject: [PATCH 29/35] libstdc++: do not throw exceptions for non-C locales on - musl targets +Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl + targets --- libstdc++-v3/config/locale/generic/c_locale.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc -index 8849d78fdfa..aff467f98fe 100644 +index bfd02b5c2c6..16f9e84d66f 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 @@ -23,5 +23,5 @@ index 8849d78fdfa..aff467f98fe 100644 void -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-riscv64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch similarity index 66% rename from cross/gcc-riscv64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch rename to cross/gcc-riscv64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch index fde874c35..452ced2ee 100644 --- a/cross/gcc-riscv64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch +++ b/cross/gcc-riscv64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch @@ -1,17 +1,18 @@ -From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001 +From 22d69ae3e2768d301ef5a1f1b362c25cf8bf27b9 Mon Sep 17 00:00:00 2001 From: Mathias LANG Date: Mon, 17 Jan 2022 03:49:21 +0000 -Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against - libucontext +Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext ref: alpine/aports#13422 --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/Makefile.in b/Makefile.in +index 20f535a306a..c087bfe7cd4 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -54362,7 +54362,7 @@ configure-target-libphobos: +@@ -54382,7 +54382,7 @@ configure-target-libphobos: esac; \ module_srcdir=libphobos; \ rm -f no-such-file || : ; \ @@ -20,3 +21,6 @@ ref: alpine/aports#13422 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.50.1 + diff --git a/cross/gcc-armhf/0031-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-riscv64/0033-druntime-link-against-libucontext-on-all-platforms.patch similarity index 81% rename from cross/gcc-armhf/0031-druntime-link-against-libucontext-on-all-platforms.patch rename to cross/gcc-riscv64/0033-druntime-link-against-libucontext-on-all-platforms.patch index 72f9370ee..920cf677e 100644 --- a/cross/gcc-armhf/0031-druntime-link-against-libucontext-on-all-platforms.patch +++ b/cross/gcc-riscv64/0033-druntime-link-against-libucontext-on-all-platforms.patch @@ -1,7 +1,7 @@ -From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001 +From dc66835022cf68085400f2eed30614c5afdc28a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sat, 16 Jul 2022 09:21:11 +0200 -Subject: [PATCH 31/35] druntime: link against libucontext on all platforms +Subject: [PATCH] druntime: link against libucontext on all platforms On musl-based Linux distributions, swapcontext etc. are not provided by musl but instead by libucontext. Hence, we _always_ need to link against @@ -11,9 +11,11 @@ an external library for these functions. libphobos/m4/druntime/libraries.m4 | 8 -------- 2 files changed, 16 deletions(-) +diff --git a/libphobos/configure b/libphobos/configure +index 4f5be7d4ff4..0a48032edb4 100755 --- a/libphobos/configure +++ b/libphobos/configure -@@ -15375,14 +15375,6 @@ fi +@@ -15420,14 +15420,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 @@ -28,6 +30,8 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 $as_echo_n "checking for library containing swapcontext... " >&6; } +diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 +index 8dd9c7da107..b61bf528a14 100644 --- a/libphobos/m4/druntime/libraries.m4 +++ b/libphobos/m4/druntime/libraries.m4 @@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], @@ -45,3 +49,6 @@ an external library for these functions. if test "$druntime_fiber_asm_external" = no; then AC_SEARCH_LIBS([swapcontext], [c ucontext], [], AC_MSG_ERROR([swapcontext required but not found])) +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0033-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-riscv64/0033-libphobos-do-not-use-LFS64-symbols.patch deleted file mode 100644 index 138bd64b7..000000000 --- a/cross/gcc-riscv64/0033-libphobos-do-not-use-LFS64-symbols.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 29 May 2023 15:33:11 +0000 -Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols - -musl does not have these since 1.2.4, we can't use the compat interfaces. ---- - libphobos/libdruntime/core/sys/posix/config.d | 2 +- - libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- - 2 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d -index ae6752f220e..6b80d1ff0e6 100644 ---- a/libphobos/libdruntime/core/sys/posix/config.d -+++ b/libphobos/libdruntime/core/sys/posix/config.d -@@ -88,7 +88,7 @@ else version (CRuntime_Musl) - enum __REDIRECT = false; - - // Those three are irrelevant for Musl as it always uses 64 bits off_t -- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64; -+ enum __USE_FILE_OFFSET64 = false; - enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT; - enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT; - -diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d -index 0d3d517d69a..323aa0af72d 100644 ---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d -+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d -@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) - } - else version (CRuntime_Musl) - { -- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); -- static if (__USE_FILE_OFFSET64) -- alias mmap = mmap64; -- else -- void* mmap(void*, size_t, int, int, int, off_t); -+ void* mmap(void*, size_t, int, int, int, off_t); - int munmap(void*, size_t); - } - else version (CRuntime_UClibc) --- -2.41.0 - diff --git a/cross/gcc-aarch64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-riscv64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch similarity index 64% rename from cross/gcc-aarch64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch rename to cross/gcc-riscv64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch index b53e5847d..38354fa65 100644 --- a/cross/gcc-aarch64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +++ b/cross/gcc-riscv64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch @@ -1,15 +1,17 @@ -From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001 +From ab88348da140c68e5e1142041dbe1c7b7d9c9a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 19 Jul 2022 14:54:07 +0200 -Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc +Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc --- gcc/ada/libgnat/s-parame.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 98284a4d13e..0d14f116a10 100644 --- a/gcc/ada/libgnat/s-parame.ads +++ b/gcc/ada/libgnat/s-parame.ads -@@ -100,7 +100,7 @@ package System.Parameters is +@@ -101,7 +101,7 @@ package System.Parameters is -- Characteristics of time_t type -- ------------------------------------ @@ -18,3 +20,6 @@ Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc -- Number of bits in type time_t ---------------------------------------------- +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0035-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-riscv64/0035-libphobos-do-not-use-LFS64-symbols.patch new file mode 100644 index 000000000..692f764f6 --- /dev/null +++ b/cross/gcc-riscv64/0035-libphobos-do-not-use-LFS64-symbols.patch @@ -0,0 +1,30 @@ +From f865fb0a27252bd3a01fc4596f101d389929311c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 29 May 2023 15:33:11 +0000 +Subject: [PATCH] libphobos: do not use LFS64 symbols + +musl does not have these since 1.2.4, we can't use the compat interfaces. +--- + libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d +index b1eb9fa8107..3aee0d96319 100644 +--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d ++++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d +@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) + } + else version (CRuntime_Musl) + { +- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); +- static if (__USE_FILE_OFFSET64) +- alias mmap = mmap64; +- else +- void* mmap(void*, size_t, int, int, int, off_t); ++ void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); + } + else version (CRuntime_UClibc) +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0034-libgo-fix-lfs64-use.patch b/cross/gcc-riscv64/0036-libgo-fix-lfs64-use.patch similarity index 98% rename from cross/gcc-riscv64/0034-libgo-fix-lfs64-use.patch rename to cross/gcc-riscv64/0036-libgo-fix-lfs64-use.patch index cf47858d6..355edd642 100644 --- a/cross/gcc-riscv64/0034-libgo-fix-lfs64-use.patch +++ b/cross/gcc-riscv64/0036-libgo-fix-lfs64-use.patch @@ -1,7 +1,7 @@ -From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001 +From cf6ba089ba26cd970962e874a3e35f020c3e921c Mon Sep 17 00:00:00 2001 From: psykose Date: Mon, 10 Jul 2023 23:23:29 +0000 -Subject: [PATCH 34/35] libgo: fix lfs64 use +Subject: [PATCH] libgo: fix lfs64 use --- .../go/internal/syscall/unix/at_largefile.go | 2 +- @@ -191,5 +191,5 @@ index 180f5c31d74..1d717d55c0e 100644 EREF(PRIO_USER); EREF(RUSAGE_SELF); -- -2.41.0 +2.50.1 diff --git a/cross/gcc-riscv64/0036-libphobos-add-riscv64-and-loongarch64-support.patch b/cross/gcc-riscv64/0036-libphobos-add-riscv64-and-loongarch64-support.patch deleted file mode 100644 index ba8377b1d..000000000 --- a/cross/gcc-riscv64/0036-libphobos-add-riscv64-and-loongarch64-support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Celeste -Date: Mon, 2 Sep 2024 02:54:17 +0000 -Subject: [PATCH] libphobos: add riscv64 and loongarch64 support - -Add musl support for these 2 architectures based on fenv.h and signal.h from: - -https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5 - -https://git.musl-libc.org/cgit/musl/tree/arch/loongarch64/bits?h=v1.2.5 ---- - libphobos/libdruntime/core/stdc/fenv.d | 13 +++++++++++++ - libphobos/libdruntime/core/sys/posix/signal.d | 10 ++++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d -index a7364c0a..5b327e4a 100644 ---- a/libphobos/libdruntime/core/stdc/fenv.d -+++ b/libphobos/libdruntime/core/stdc/fenv.d -@@ -436,20 +436,33 @@ else version (CRuntime_Musl) - ushort __cs_selector; - ushort __opcode; - uint __data_offset; - ushort __data_selector; - ushort __unused5; - version (X86_64) - uint __mxcsr; - } - alias ushort fexcept_t; - } -+ else version (RISCV64) -+ { -+ alias uint fenv_t; -+ alias uint fexcept_t; -+ } -+ else version (LoongArch64) -+ { -+ struct fenv_t -+ { -+ uint __cw; -+ } -+ alias uint fexcept_t; -+ } - else - { - static assert(false, "Architecture not supported."); - } - } - else version (CRuntime_Newlib) - { - version (AArch64) - { - alias fenv_t = ulong; -diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d -index a8b7f751..78d8b3cd 100644 ---- a/libphobos/libdruntime/core/sys/posix/signal.d -+++ b/libphobos/libdruntime/core/sys/posix/signal.d -@@ -2751,20 +2751,30 @@ else version (CRuntime_Musl) - else version (PPC_Any) - { - enum MINSIGSTKSZ = 4096; - enum SIGSTKSZ = 10240; - } - else version (X86_Any) - { - enum MINSIGSTKSZ = 2048; - enum SIGSTKSZ = 8192; - } -+ else version (RISCV64) -+ { -+ enum MINSIGSTKSZ = 2048; -+ enum SIGSTKSZ = 8192; -+ } -+ else version (LoongArch64) -+ { -+ enum MINSIGSTKSZ = 4096; -+ enum SIGSTKSZ = 16384; -+ } - else - static assert(0, "unimplemented"); - - //ucontext_t (defined in core.sys.posix.ucontext) - //mcontext_t (defined in core.sys.posix.ucontext) - - version (MIPS_Any) - { - struct stack_t - { diff --git a/cross/gcc-riscv64/0035-loongarch-disable-multilib-support.patch b/cross/gcc-riscv64/0037-loongarch-disable-multilib-support.patch similarity index 87% rename from cross/gcc-riscv64/0035-loongarch-disable-multilib-support.patch rename to cross/gcc-riscv64/0037-loongarch-disable-multilib-support.patch index acfc47c7f..da7e8b34d 100644 --- a/cross/gcc-riscv64/0035-loongarch-disable-multilib-support.patch +++ b/cross/gcc-riscv64/0037-loongarch-disable-multilib-support.patch @@ -1,15 +1,15 @@ -From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001 +From a809e7b909e16fcf3379571417d33574e9c1dbff Mon Sep 17 00:00:00 2001 From: Jingyun Hua Date: Mon, 7 Aug 2023 15:25:58 +0800 Subject: [PATCH] loongarch disable multilib support Signed-off-by: Jingyun Hua --- - gcc/config/loongarch/t-linux | 11 +++-------- + gcc/config/loongarch/t-linux | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux -index 23e1fb979..c2753abb8 100644 +index 45862048abf..73155acd832 100644 --- a/gcc/config/loongarch/t-linux +++ b/gcc/config/loongarch/t-linux @@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) @@ -28,5 +28,5 @@ index 23e1fb979..c2753abb8 100644 + MULTILIB_OSDIRNAMES += mabi.lp64f=../lib + MULTILIB_OSDIRNAMES += mabi.lp64s=../lib -- -2.41.0 +2.50.1 diff --git a/cross/gcc-armhf/0037-static-pie.patch b/cross/gcc-riscv64/0038-static-PIE-ensure-static-reaches-the-linker.patch similarity index 72% rename from cross/gcc-armhf/0037-static-pie.patch rename to cross/gcc-riscv64/0038-static-PIE-ensure-static-reaches-the-linker.patch index a31c20e7e..bd870a370 100644 --- a/cross/gcc-armhf/0037-static-pie.patch +++ b/cross/gcc-riscv64/0038-static-PIE-ensure-static-reaches-the-linker.patch @@ -1,17 +1,26 @@ -Patch-Source: https://github.com/richfelker/musl-cross-make/blob/6f3701d08137496d5aac479e3a3977b5ae993c1f/patches/gcc-14.2.0/0004-static-pie.diff +From 72606254a2456763cb252b4d729a9505e77e449d Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Fri, 25 Jul 2025 02:41:46 -0700 +Subject: [PATCH] static PIE: ensure -static reaches the linker -gcc doesn't enable static-pie for all arches. As of this writing arm -32-bit is missing. musl supports static-pie on all arches so this -should be allowed on all arches. +on some targets, the logic for the compiler option -static seems not +to be processed when -pie is present. rather than playing +whack-a-mole, just ensure LD_PIE_SPEC specs always pass -static to ld +if either -static or -static-pie is present on the compiler driver +command line. -Without this patch binaries with (only) -static-pie are broken on some -arches. +this may produce redundant -static arguments but it doesn't matter. +--- + gcc/common.opt | 4 ++-- + gcc/config/gnu-user.h | 17 ++++++++--------- + gcc/gcc.cc | 6 +++--- + 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 +index e65a575d9f8..7ad38711f6e 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver +@@ -3968,11 +3968,11 @@ Driver no-pie Driver RejectNegative Negative(shared) @@ -26,7 +35,7 @@ index a75b44ee47e..7c564818b49 100644 static-pie Driver RejectNegative Negative(pie) diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 +index 0426efdb8c3..866c8bd77f2 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see @@ -70,12 +79,12 @@ index 5ebbf42a13d..bb907d8e89a 100644 +#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " #endif - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ + #if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) diff --git a/gcc/gcc.cc b/gcc/gcc.cc -index 3c81c5798d8..cd96eac5d12 100644 +index e9f78f0f4c1..767ff65f348 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ +@@ -1056,7 +1056,7 @@ proper position among the other output files. */ #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" #else @@ -84,12 +93,12 @@ index 3c81c5798d8..cd96eac5d12 100644 #define FPIE1_SPEC "fpie" #define NO_FPIE1_SPEC FPIE1_SPEC ":;" #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ +@@ -1080,12 +1080,12 @@ proper position among the other output files. */ #ifndef LINK_PIE_SPEC #ifdef HAVE_LD_PIE #ifndef LD_PIE_SPEC -#define LD_PIE_SPEC "-pie" -+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic %{static-pie:-static}}" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic -static}" #endif #else #define LD_PIE_SPEC "" @@ -99,3 +108,6 @@ index 3c81c5798d8..cd96eac5d12 100644 #endif #ifndef LINK_BUILDID_SPEC +-- +2.50.1 + diff --git a/cross/gcc-riscv64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-riscv64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch similarity index 97% rename from cross/gcc-riscv64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch rename to cross/gcc-riscv64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch index b55477e53..c713030bb 100644 --- a/cross/gcc-riscv64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +++ b/cross/gcc-riscv64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch @@ -1,4 +1,4 @@ -From 49926c2c657dd867f7329df6e250913fd1425475 Mon Sep 17 00:00:00 2001 +From d984c5c9ed973bb7072b48399e5d9bb1f35c3123 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 28 Mar 2025 17:25:56 -0700 Subject: [PATCH] except: Don't use the cached value of the gcc_except_table @@ -73,5 +73,5 @@ index 00000000000..50afa75a43f +// There should be 3 exception tables, +// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } -- -2.49.0 +2.50.1 diff --git a/cross/gcc-riscv64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch b/cross/gcc-riscv64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch new file mode 100644 index 000000000..a25266014 --- /dev/null +++ b/cross/gcc-riscv64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch @@ -0,0 +1,164 @@ +From 57eb290b3c8fc36da99213f5050b46cd93575234 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Sat, 26 Jul 2025 02:59:45 -0700 +Subject: [PATCH] ada: libgnat: use stub symbolic module name functions + +The "linux" implementation depends on glibc internals and accordingly +does not work on musl. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/Makefile.rtl | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index cb41e6887cd..152ba70db4d 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1642,7 +1642,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb +Date: Sat, 26 Jul 2025 03:02:38 -0700 +Subject: [PATCH] ada: libgnat: recognize linux-musleabi and linux-muslgnueabi + platforms for ARM + +--- + gcc/ada/Makefile.rtl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 152ba70db4d..89574cdfba7 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2500,7 +2500,7 @@ endif + + # ARM linux, GNU eabi + ifeq ($(SELECTED_PAIRS),PAIRS_NONE) +-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),) ++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),) + + SELECTED_PAIRS=arm-linux-gnueabi + +-- +2.50.1 + diff --git a/cross/gcc-riscv64/APKBUILD b/cross/gcc-riscv64/APKBUILD index d56629f1c..99c59aeb0 100644 --- a/cross/gcc-riscv64/APKBUILD +++ b/cross/gcc-riscv64/APKBUILD @@ -24,7 +24,7 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-riscv64 -pkgver=14.3.0 +pkgver=15.1.1_git20250719 # i.e. 13.2.1, must match gcc/BASE-VER _pkgbase="${pkgver%%_git*}" # date component from snapshots @@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-riscv64 -pkgrel=6 +pkgrel=2 pkgdesc="Stage2 cross-compiler for riscv64" url="https://gcc.gnu.org" arch="x86_64" @@ -183,7 +183,7 @@ if $_libgomp; then fi case "$CTARGET_ARCH" in -riscv64|loongarch64) +riscv64) LANG_ADA=false;; esac @@ -241,7 +241,7 @@ fi # PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches, # so that they can be properly tracked and easily rebased if needed. #source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz -source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz +source="https://gcc.gnu.org/pub/gcc/snapshots/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-specs-turn-on-Wl-z-now-by-default.patch @@ -249,37 +249,40 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch 0006-Enable-Wformat-and-Wformat-security-by-default.patch 0007-Enable-Wtrampolines-by-default.patch - 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch - 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch - 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch - 0011-libiberty-copy-PIC-objects-during-build-process.patch - 0012-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-libphobos-do-not-use-LFS64-symbols.patch - 0034-libgo-fix-lfs64-use.patch - 0035-loongarch-disable-multilib-support.patch - 0036-libphobos-add-riscv64-and-loongarch64-support.patch - 0037-static-pie.patch - 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch + 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch + 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0012-libiberty-copy-PIC-objects-during-build-process.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-ada-fix-shared-linking.patch + 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0017-add-fortify-headers-paths.patch + 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0020-aarch64-disable-multilib-support.patch + 0021-s390x-disable-multilib-support.patch + 0022-ppc64-le-disable-multilib-support.patch + 0023-x86_64-disable-multilib-support.patch + 0024-riscv-disable-multilib-support.patch + 0025-always-build-libgcc_eh.a.patch + 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch + 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch + 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch + 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch + 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch + 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch + 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch + 0033-druntime-link-against-libucontext-on-all-platforms.patch + 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch + 0035-libphobos-do-not-use-LFS64-symbols.patch + 0036-libgo-fix-lfs64-use.patch + 0037-loongarch-disable-multilib-support.patch + 0038-static-PIE-ensure-static-reaches-the-linker.patch + 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch + 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " # secfixes: @@ -287,8 +290,8 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz # - CVE-2023-4039 # we build out-of-tree -#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap -builddir="$srcdir"/gcc-$_pkgbase +builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap +#builddir="$srcdir"/gcc-$_pkgbase _gcclibdir="usr/lib/gcc/$CTARGET/$_pkgbase" _gcclibexec="usr/libexec/gcc/$CTARGET/$_pkgbase" @@ -752,43 +755,46 @@ gdb() { } sha512sums=" -cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93 gcc-14.3.0.tar.xz -1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch -6dd1eecbc050e30e5a0493969a0e80507d971f4ca87c06466f725fa50c9106e18aef86453fc8a80cd277438b6e79695a99cdaf2eaeb2f1add7e28f7cffd0cd2f 0002-gcc-poison-system-directories.patch -b6903b60b01187bfebc961e74d01ff5d8dc2852747663dff2b4a4f66df4b5aa412347fe92926cce1821fdd0c59d088404acbbced4b464aba9664d599a9e1bbce 0003-specs-turn-on-Wl-z-now-by-default.patch -d41a519ea5014e9ab49f017d3793e2a0a82429c2b7ded2776f2df7a2d0ac02aa294e7dbe74e027fe7c844c87525d483e0eda3846cf16340eb02e934389cfd838 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e34d7bb51c4c413b1a10bafcdfd5729fb5980b0288277ef44ed4779700d443d2fd22129b3b22d401def140851263e803160d2f3ed8825b0bf4f3fb8606db77bd 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -83665b6adb0b8080245b253abe3344ee5106ac2bc248aad9bef713b22b644a268d75c75fbab7554e0543836903a89bc4f0bec4b6d6d4e3d5ba355dddbc5ba190 0006-Enable-Wformat-and-Wformat-security-by-default.patch -ca5757a32f02bb24bc5b42bb03dca49fb9f9e6f34776343f1c5580efd2bcacf8c5b59f4b61652fa3ea1506eb14bcd390f5fda7b4cbfd32f7d1a750d14add4739 0007-Enable-Wtrampolines-by-default.patch -e476da4c2f29a941b7f4f1dfc9a37ba82b439badc47fc3fb72630ec5620f64849bdb66d339e0182674a0ee898a75564ffaf702986b770bfd793e7fbdcaa9f21b 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch -b40b6cbc3725ae88c506bc39a8ba10cfcdcc208fa26d667393bbb80e24346da2ccfac3ff914bb9fc4c374f022fa7f913e6873b9a66a96b79a1ac84959c9d5348 0012-libgcc_s.patch -6cc2c00b15d259289fa9831b60b58f8afdf09858410bd08ab3d839a45c6f3fb9e8e214dab851d105c61df7965f1c10255c84b5b6301630a390b27b8929a25e1e 0013-nopie.patch -0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch -7640e71cd957066e2e07ffcec1f8540cd6b1bdaf976c980693bf6f5d3afaf51ca7e41c62f92cb13c86c2dea9eb9cd799b2e3ea77d74926e82bf1e12bb7a4d64e 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch -8a8c9dc96f300f660f1a643c800352383f32db258dfcfa88a44159a38bb81a7298089a5dcb23906002c85cafc806caf6f3db0e1cb26fcac6192ae1e41d9ada3a 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -6c1cbfcf9e6f54b2173af39bbbfd97e7c18ae32a690fb4c6b1e35fa183992ea0f8046d479be57b6ac7d798bf2a6dade4f9ea3e3a839dc6fb8d47203de9c89e25 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch -a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch -f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch -44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch -0ef65a344975b641343767e289578ba5b0fd381c7177ebe4558cb67d8b41e33e3b825478fa46852f1f40ec9119ff908cf75ee36307266aea13f39460e080b0b6 0023-riscv-disable-multilib-support.patch -55438233a217dc1ee58990413b8782b9bd560a1532c1e6c860f377072ed1bdf75d5dc2458ed33194040ec5427c30df3fa68948dcd26de90e3803d3f7b784becd 0024-always-build-libgcc_eh.a.patch -8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch -02e8358b8855fb49bbb2b3ef293cff67441c5fdf1f2fee4dcec86ef1fd4f701e899ea9c7e072d888b0f1e674d7874d3085138f3deb9845d1f2e35d4a1fe3f5ab 0026-ada-musl-support-fixes.patch -8eff7679140f9e39f1a0ac2e4a6cc7e131efa3d5a669696dd28300eb5d75ef3be62f10c1b91d8f8c8ba2cba1ff9cf121228b6fcd3adafa28389ac63698e7d5a7 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch -720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch -2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch -458c9b121e00cec4d0dbe1d18c5e5332342eb0a3429129e5a9d9ace3247c31d85571ad9f47046c4ed3bc62e5d8a4297f48744a30424a19acbdd9aa484e3ee715 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch -099103f4b0b4612ff4bd2e8721cf1593415b636bff74d4feba304bb610ced6f4951cb3ab89088111e58029a2f9bf4a5dcc91e2b2afe4dd9813d2fa6b0999a5a2 0031-druntime-link-against-libucontext-on-all-platforms.patch -21ff4d55eec48ad4a9db0cd359e760cff548f7f6b1a67759a2e87fc7e16a262d82d2f980d309a3ce5e14097665beeb5516a5f2d98869a5d28345e685c6fe689d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch -c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch -c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch -65df1d489e8d07a811f39e27fd29e3b2b4164fbc2c5fdc16a5142886d94a96e3fb28ccf4f20dd297ba6540ef8ea1ac3eb65a4279494639bf2f0f8376a3896cc3 0035-loongarch-disable-multilib-support.patch -06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch -8249ce989c1a76bcb5bbb1123ef88d88f220b709fe6ac804f18c905a7b31c4e68ef6f5cc2236f446feed89fa773a3aed996a6aba7618e73a000d73cb0b0753f6 0037-static-pie.patch -90b6148d47f39caf1b70416abf2a09f4ce048491f784f56bd659dbf99e2c9f6a44b244827f23977494ab4e42640c49c1dc79f43a4d69c2b31c4b1e25d54d8142 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +a5e0082e492502385565479201bca3e9f5138a55d83540bff8b84a94d958c4d2afce474328656ee7d55fad910c04523c0068efe92382e68a327a65f6e641b88a gcc-15-20250719.tar.xz +fd5cebc5deb1d588583424acbc1b5a6d8d6f5b1bfa9f4bdbc082cfd406723f423d87011ee30e04ed18128a7ed8021cbfc9262becff5419125dc1afb6f407defa 0001-posix_memalign.patch +6634004cb9feea9ee0d063d6b6984d7db3b10c692b6139bb99169a4f2d74f0e10b5ca0ab31ce346ffef34b8eb9c3f536aa4d94bce1b27f8e0b8a9fc5cc4b7057 0002-gcc-poison-system-directories.patch +37e089791dbcbad73af866b662cda611dc0970d93e28251c7a9aa898db3b96446654e8b778d7866eb8550ba7f4a57cf22e8514d562bfed0c66613e65550d9c85 0003-specs-turn-on-Wl-z-now-by-default.patch +d4d5bfeb20a9fac968f37497d86d7eff4a9ac863e015dadbffae24c08236f5efde69b615d95191e2546672ce2d4b30d3627528c64a83fc64b715e8fa6fd4c372 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +b77cd1ee887fc52afee2fafd2d338f70a62c115017aa4fcb0ab9cf82b8a003794f75b7913cc153c767c351d2be8e1e7c113f893edee818217f20cad3cb6a2e66 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +af634de360e8b7aef285702815affb16da667719b786848ccdb9e4cca2a27826793f64c903a32a5d8ba1953965a5cc8999c58e2b6ce9ef36f74807e495cc9e42 0006-Enable-Wformat-and-Wformat-security-by-default.patch +21ad1cd4b7ef652ddaf6b9fb8071a87ec2fc694e8c420a79baf456347b8e1db5930a914c92a375943dda63d096c4823a2b8028d02a5b49c9bcdab5c170558004 0007-Enable-Wtrampolines-by-default.patch +dcd07ecf0daad8743a378abbcb921d4b17e528651a596454956563a3417fe9ea3b88dce7b15b9270f55ae2ea2a72efe8a7215236d0a21e2942c7c5ba0e8e2c39 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch +488bd530e209e3213f83d695fb2ac529c408e3dba9024457594cfb0d266acb079447bca184fbf136bacd1f1ec5ca3607dc4998b66630af9781ea7ee41c16236b 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch +7229a3fe655e8460148e0cd4c39d7362e713d1a6215530547f346371a5e3647245123637e8b075c58c5e7e35c823d96a0b3cdbedb6c07b5095507b4499bc053a 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +f7c1870bda4d418380f471b520b7cf20fde743f57415323c1a8898a815f8c7023adc3882e1d0453c5b6fcb65a27a9534fdeb297bf451453a95d90c0395e42c3b 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch +140c8165726404da0fc0ea01add2a7fa307377817968177334c520bdaabc23e8ec5d76f80337b89ff03edfd52dead7119433a03d2165e24780dc944633a9c2a3 0012-libiberty-copy-PIC-objects-during-build-process.patch +af848ef58b63a7592ad0f549be65fbe8dcd3c1e5ea9f30cfa65be02519ca9826d7612131c3b0042615b7537683d74eeb6849aba61810b0d8ed1c79f968188260 0013-libgcc_s.patch +c97b473c08b46090b48764af55b244ec70a13d26f2d881c57761abbc4a1c481da9766f33e59daee7188bc06c4631e53becbaf8801d0b35ca0b5fe84cb6a840f7 0014-nopie.patch +9c37cc38bb7238058751d3ff60712acd4134aa4c28d946c453b8b230bd6ba34c45c47a4b4d7e74aa7e3ed8dfc74cbb1d5a328bda706dd3037320e02a15421b86 0015-ada-fix-shared-linking.patch +b4afb30431ecdfd86acfd66ba857c275628b55e91cc9b21c18ca0e795b2fadfe895da801978a8e818ff9c93144075e72cf0521f3bce5c6c1d44e47e1b77b8ba4 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +6260341ed13926ce449cf351ada85d8e28fc7da63a4ae73b69c24fb2e8d0e3003ffacb1bb0f957185b8d5d7e013f777f7f696c9a1c94b2204a9b3e8274ec2f43 0017-add-fortify-headers-paths.patch +8fe954daf7e9b1d221f0536f54186bc1715e23cf3c74dfd0956c0fa22ce3b5b5e30b5e17ea584db1cc193ac7fdc72daff68c9163dbc46a837e01d25a7a4a90e0 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +fc5ce12cd70382b15317931ff0f57ae1ed10e8c09dbf2fee627bc55a268f55ebbf9ae32b89b4ef6f51e9a9b7ca32eed201245d481cde88f6eb572d40134f5f4c 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +e0d4fd0e0bf4ecfb517b60b55d73f326deda0faa75bfd07d1fcae116f91088a96caaa2dd20e2e38a93cc8ffed0aef422c0c861879c8de406364faef0cbcd50ff 0020-aarch64-disable-multilib-support.patch +7af318ea6fe14dce98b8db1f8f46a2dc9f75c2f27e63a52c62c7b47d6d62cb64748d5c2690eba772d931ff96ac089e3f03bf46b49122ffb5a03a1c186f01ae11 0021-s390x-disable-multilib-support.patch +b96dbbd0e1aa98ebc2e7eaa2a44912681e4c8bc9a129fafa53a943d67b62451b6d4fad53f92429cd4346a753527359c8c09d58836cf0968a56f5fe933496a412 0022-ppc64-le-disable-multilib-support.patch +60106cb08f27c89509ba46dc2ff0edecc1f4c7973874c85047dfdd67eabe50e3a852d7540002a09bcb6185c786a5daeba7915958c441fc92d7f16a0cce5bcdea 0023-x86_64-disable-multilib-support.patch +d55d65242af9341eef7f1e3d03fec2e2de75632a23ed83df4fe6304619f62127b42eba9d9286f7f3647e3b9bd95aaeb79023263e71ff9d58c47f3051b73d8bc2 0024-riscv-disable-multilib-support.patch +b6dda179cafbd9e7f3ef7e137b303a76491a0157d68f1504dee6611cecdca16d27ca32cbd2298da2f6301e7167b8730d70a775ee5ba88ae3773adef8421efa98 0025-always-build-libgcc_eh.a.patch +95245b6548ddca5065bac06131294028767a32740c80f707a4d1cf8653a0398305ec68e7c44a3f2912741b792d41048f03729657b0a1c1a2a7bff097c6b2fdc7 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch +ff6b8b9e1ab9b45d1853e74befb5c904cf7cd83dadb5a4b6f8c94a75e6249d1cdaa72aef73d6b1045beabc2d9012ea869d886015ec3aae561eb4ba8b9d00c2d7 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch +0582f00e8801df06e51fca45a8dc3ee62e9b6ce9245af98937f435c90c709edc7eb9071569c0e59c9a143d964fe5731b9e11b011174443b97043abddc9db1cce 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch +8683314212c0a6f49ed45ea8c74908f59d863822fa8c99e94c7e39ba3a642ca6a3167543e1ae4b58d8acd1ff97824d6e60cc432b19e6580cad2027e3a5c37603 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +60bb67f6cf4b92243dec861fba702aa5847925bf413c2c83705a0ee4ebe4c523cc295cce29666c69c9b2dec70d63def83cd9074e613b4f46e014248f53c87db4 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch +b49f72cce409f74407761fe64b028e97d58e4f236af7d9099189a8553f2ece3f30559760fab768f3d1fc4c7f89ae3ee6d687018251f3df52c9a43817c9c7c93e 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +0bd3aa81590d5f47205e193d2998bb5986cbb82adb75e3d39dcf820625bb358d380d1695ebbb18437fdd935ce350b0f5b7364a5fa7c8e07ebe8f972c8cd46cd1 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch +e8d5c4159f41fcb09e76758768d127ff366c93095137b694a405e9dbba88f2036ba64b69ac6c5c75e488be3281a1227cccbadcea2bef6f60ba0be7fc3d7db754 0033-druntime-link-against-libucontext-on-all-platforms.patch +6f530cdb1935296925ec29be7a30e4d69cebc155695db6ea30ee95ce65de7e8917e2a6148d3668974715120e7f13f734e5c36bfd35f707f4725a7556cbc1caa5 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +1dabb0c8d581ec86d8758dfa3d2f1713d915f6d927639f56b3590ed9b0885dfdf452e30ca87edac49721d2dc43d4fbdb4d178f8448e8ba5cc595457f216bf210 0035-libphobos-do-not-use-LFS64-symbols.patch +b915a0eaf7cc3e48f41f31ebbd9142760891b9ede304ff3f1dc7166f85a9e3f82017a17bb7e65824d3da07445b2c8bcd156a992eed92633362c08329b04b6cb4 0036-libgo-fix-lfs64-use.patch +0164467e66719187b6041c8d2d717a9bcd5b8c801dab6391b0e503c41e26518cc78389c97bdd2b2bc64f660f95410439aaa8a20799ec01eab17e7ba415ac1dd9 0037-loongarch-disable-multilib-support.patch +2cae2cb470b2cf469973c0ff3a7a020960cf4325502ff6c84c6b1b3514c8cacfae8452b5c79b55e657b0877fc9d81cc68db6f650156ca6d1376c1bd1a2290d8b 0038-static-PIE-ensure-static-reaches-the-linker.patch +7d73041566678fc86885877d8315481bf358858cbe54227356d5ab48623e435426ac7ff6e54d21b9fee4cc73e3f4bc7ef646d3e4ab1970e524c890cd1f735905 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +4556ead97907ec76aaa7dde450e4b6068f87268c49168eeb2af0c3df1dfa312b0a4a947b65b11fd413dae9af0beb3ef002d077c0d7f43b0bc466d3cd4348e657 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch +389eacbeba976a461af3d087d732d1c4f2a38bc5db91b935149e60ad4b210286ba76688b8a947d00f324566b6789152bf3b93a188fa2fb7ee8042786df483fed 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " diff --git a/cross/gcc-x86/0001-posix_memalign.patch b/cross/gcc-x86/0001-posix_memalign.patch index 04240c29c..bbc2db9ca 100644 --- a/cross/gcc-x86/0001-posix_memalign.patch +++ b/cross/gcc-x86/0001-posix_memalign.patch @@ -1,14 +1,14 @@ -From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001 +From 94cf7d2b3514ed3a4401861a519ead450e022afc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/35] posix_memalign +Subject: [PATCH] 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 3527283693b..c4071b64b53 100644 +index d1d79a32fc9..069c3bb8324 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ @@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644 else return NULL; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-x86/0002-gcc-poison-system-directories.patch b/cross/gcc-x86/0002-gcc-poison-system-directories.patch index 9a1671267..de66b72d0 100644 --- a/cross/gcc-x86/0002-gcc-poison-system-directories.patch +++ b/cross/gcc-x86/0002-gcc-poison-system-directories.patch @@ -1,7 +1,7 @@ -From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001 +From 0d5e04099a3d2609105719f7396a4ff941b873b6 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/35] gcc: poison-system-directories +Date: Thu, 23 Jan 2025 17:12:51 -0800 +Subject: [PATCH] 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 @@ -11,23 +11,25 @@ aborted. Instead, we add the two missing items to the current scan. If the user wants this to be a failure, they can add "-Werror=poison-system-directories". +Upstream-Status: Inappropriate [OE configuration] Signed-off-by: Mark Hatle +Signed-off-by: sunil dora Signed-off-by: Khem Raj - -Upstream-Status: Pending --- gcc/common.opt | 4 ++++ - gcc/config.in | 6 ++++++ - gcc/configure | 16 ++++++++++++++++ - gcc/configure.ac | 10 ++++++++++ + gcc/config.in | 10 ++++++++++ + gcc/configure | 19 +++++++++++++++++++ + gcc/configure.ac | 16 ++++++++++++++++ gcc/doc/invoke.texi | 9 +++++++++ - gcc/gcc.cc | 2 ++ - gcc/incpath.cc | 21 +++++++++++++++++++++ - 7 files changed, 68 insertions(+) + gcc/gcc.cc | 12 ++++++++++-- + gcc/incpath.cc | 25 +++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 2 deletions(-) +diff --git a/gcc/common.opt b/gcc/common.opt +index e3fa0dacec4..bea1adc0940 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -715,6 +715,10 @@ Wreturn-local-addr +@@ -729,6 +729,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. @@ -38,9 +40,11 @@ Upstream-Status: Pending Wshadow 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 a79c51adb2b..8a531ed591c 100644 --- a/gcc/config.in +++ b/gcc/config.in -@@ -249,6 +249,12 @@ +@@ -249,6 +249,16 @@ #endif @@ -48,14 +52,20 @@ Upstream-Status: Pending +#ifndef USED_FOR_TARGET +#undef ENABLE_POISON_SYSTEM_DIRECTORIES +#endif ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef POISON_BY_DEFAULT ++#endif + + /* Define if you want all operations on RTL (the basic data structure of the 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 16965953f05..0f4a5d52c30 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1050,6 +1050,7 @@ enable_maintainer_mode +@@ -1051,6 +1051,7 @@ enable_maintainer_mode enable_link_mutex enable_link_serialization enable_version_specific_runtime_libs @@ -63,7 +73,7 @@ Upstream-Status: Pending enable_plugin enable_host_shared enable_host_pie -@@ -1823,6 +1824,8 @@ Optional Features: +@@ -1828,6 +1829,8 @@ Optional Features: --enable-version-specific-runtime-libs specify that runtime libraries should be installed in a compiler-specific directory @@ -72,7 +82,7 @@ Upstream-Status: Pending --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE -@@ -34082,6 +34085,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -83,47 +93,60 @@ Upstream-Status: Pending + enable_poison_system_directories=no +fi + -+if test "x${enable_poison_system_directories}" = "xyes"; then ++if test "x${enable_poison_system_directories}" != "xno"; then + +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++if test "$enable_poison_system_directories" = "error"; then ++$as_echo "#define POISON_BY_DEFAULT 1" >>confdefs.h ++fi + +fi + # Substitute configuration variables +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 9f67e62950a..b0e3615e5aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7555,6 +7555,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) +AC_ARG_ENABLE([poison-system-directories], + AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system header directories]),, ++ [warn for use of native system header directories (no/yes/error)]),, + [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then ++AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories]) ++if test "x${enable_poison_system_directories}" != "xno"; then ++ AC_MSG_NOTICE([poisoned directories enabled]) + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], + [1], + [Define to warn for use of native system header directories]) ++ if test $enable_poison_system_directories = "error"; then ++ AC_MSG_NOTICE([poisoned directories are fatal]) ++ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors]) ++ fi +fi + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 72009c33cd0..29aea724731 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -405,6 +405,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 -@@ -8861,6 +8862,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. + -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor + -Wno-psabi + -Wredundant-decls -Wrestrict +@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default. + Suppress warnings from casts from a pointer to an integer type of a + different size. +@opindex Wno-poison-system-directories +@item -Wno-poison-system-directories @@ -133,12 +156,27 @@ Upstream-Status: Pending +directories contain the correct headers and libraries for the target +system rather than the host. + - @opindex Wfloat-equal - @opindex Wno-float-equal - @item -Wfloat-equal + @opindex Winvalid-pch + @opindex Wno-invalid-pch + @item -Winvalid-pch +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 4fd87f2c4a1..79d4920a047 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1163,6 +1163,8 @@ proper position among the other output files. */ +@@ -909,6 +909,12 @@ proper position among the other output files. */ + #define ASM_MAP "" + #endif + ++#ifdef POISON_BY_DEFAULT ++#define POISON_IS_ERROR " -Werror=poison-system-directories" ++#else ++#define POISON_IS_ERROR ++#endif ++ + /* Assembler options for compressed debug sections. */ + #if HAVE_LD_COMPRESS_DEBUG == 0 + /* Reject if the linker cannot write compressed debug sections. */ +@@ -1166,6 +1172,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}}} \ @@ -147,6 +185,26 @@ Upstream-Status: Pending %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +@@ -1268,7 +1276,7 @@ static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ + %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR; + + /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. + +@@ -1297,7 +1305,7 @@ static const char *cc1_options = + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +- %{pthread:-fprofile-update=prefer-atomic}}}"; ++ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR; + + static const char *asm_options = + "%{-target-help:%:print-asm-header()} " +diff --git a/gcc/incpath.cc b/gcc/incpath.cc +index c1bbfd3872a..2cdbebc4c50 100644 --- a/gcc/incpath.cc +++ b/gcc/incpath.cc @@ -26,6 +26,7 @@ @@ -157,9 +215,20 @@ Upstream-Status: Pending /* Microsoft Windows does not natively support inodes. VMS has non-numeric inodes. */ -@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) +@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + cur->name, xstrerror (errno)); + reason = REASON_NOENT; + } ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ pcur = &cur->next; ++ continue; ++#endif + } + else if (!S_ISDIR (st.st_mode)) + cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0, +@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + fprintf (stderr, _("End of #embed search list.\n")); } - fprintf (stderr, _("End of search list.\n")); } + +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES @@ -168,19 +237,22 @@ Upstream-Status: Pending + struct cpp_dir *p; + + for (p = heads[INC_QUOTE]; p; p = p->next) -+ { -+ if ((!strncmp (p->name, "/usr/include", 12)) -+ || (!strncmp (p->name, "/usr/local/include", 18)) -+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) -+ || (!strncmp (p->name, "/sw/include", 11)) -+ || (!strncmp (p->name, "/opt/include", 12))) -+ warning (OPT_Wpoison_system_directories, -+ "include location \"%s\" is unsafe for " -+ "cross-compilation", -+ p->name); -+ } ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } + } +#endif } /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.50.1 + diff --git a/cross/gcc-x86/0003-specs-turn-on-Wl-z-now-by-default.patch b/cross/gcc-x86/0003-specs-turn-on-Wl-z-now-by-default.patch index 33e8b56f1..be6a3dc60 100644 --- a/cross/gcc-x86/0003-specs-turn-on-Wl-z-now-by-default.patch +++ b/cross/gcc-x86/0003-specs-turn-on-Wl-z-now-by-default.patch @@ -1,7 +1,7 @@ -From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001 +From 90e8697dd88fd99ce2cf8739e95494853005377e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default +Subject: [PATCH] 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. @@ -13,9 +13,11 @@ now by default. gcc/gcc.cc | 1 + 2 files changed, 4 insertions(+) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 29aea724731..6fb3ab70cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -18935,6 +18935,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -19477,6 +19477,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}. @@ -25,9 +27,11 @@ now by default. @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 79d4920a047..74a356fdf5e 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1161,6 +1161,7 @@ proper position among the other output files. */ +@@ -1170,6 +1170,7 @@ proper position among the other output files. */ "%{flto|flto=*:% Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, - ObjC, ObjC++, if the optimization level is > 0 +Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, + ObjC++, if the optimization level is > 0 --- gcc/c-family/c-cppbuiltin.cc | 4 ++++ gcc/doc/invoke.texi | 6 ++++++ 2 files changed, 10 insertions(+) +diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc +index 4589ee4a3a6..9edf095384c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc -@@ -1570,6 +1570,10 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -1581,6 +1581,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); @@ -22,9 +24,11 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, /* Misc. */ if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 6fb3ab70cc7..799ce073dbf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -12496,6 +12496,12 @@ also turns on the following optimization flags: +@@ -12840,6 +12840,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. @@ -37,3 +41,6 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, @opindex O3 @item -O3 Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.50.1 + diff --git a/cross/gcc-x86/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/cross/gcc-x86/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 819ef5e76..deb4da3dc 100644 --- a/cross/gcc-x86/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/cross/gcc-x86/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,8 +1,8 @@ -From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001 +From a59da582e83071de0566274d912ca6f05f4b75d0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the - linker, but always link the sanitizer libraries with --no-as-needed. +Subject: [PATCH] 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 + @@ -21,9 +21,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the gcc/gcc.cc | 28 ++++++++++++++++++++-------- 14 files changed, 36 insertions(+), 19 deletions(-) +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index 116bb4e69f3..daf99f8dce9 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h -@@ -35,6 +35,7 @@ +@@ -39,6 +39,7 @@ #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ @@ -31,6 +33,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 3fd3b831166..0b4c2dccebe 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 @@ -42,6 +46,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{O*:-O3} %{!O*:-O1} \ %{shared:-shared} \ %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index d4d389e2aa8..adccc0b11c2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -52,6 +58,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 4c4e31efa39..3c17ac6eade 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 @@ -78,6 +86,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the #endif #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index 7abfda53049..ceb8f855b7d 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 @@ -89,6 +99,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index abe714711bf..3ca128a79f5 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 @@ -99,6 +111,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index a2494c214c4..e1a5d530cdf 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -110,6 +124,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5a82508c113..6eee7cdc603 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 @@ -120,6 +136,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 9060c940a44..282c77b6a7b 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see @@ -130,6 +148,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ -X \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 0316d8cb65d..139e1b6796c 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -378,13 +378,13 @@ extern int dot_symbols; @@ -148,6 +168,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!static-pie: \ %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ +diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h +index afb5c6ad867..b64638fb25b 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -159,6 +181,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 2c3bca5dfcb..b90661247a4 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 @@ -170,6 +194,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 6d928846895..3cc05bb7240 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); @@ -181,9 +207,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!static: \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 74a356fdf5e..fc9c7d15b04 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -771,8 +771,11 @@ proper position among the other output files. */ +@@ -774,8 +774,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -197,7 +225,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -807,8 +810,11 @@ proper position among the other output files. */ +@@ -810,8 +813,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -211,7 +239,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -825,8 +831,11 @@ proper position among the other output files. */ +@@ -828,8 +834,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +253,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -841,8 +850,11 @@ proper position among the other output files. */ +@@ -844,8 +853,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 @@ -239,3 +267,6 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-x86/0006-Enable-Wformat-and-Wformat-security-by-default.patch b/cross/gcc-x86/0006-Enable-Wformat-and-Wformat-security-by-default.patch index b4d580f85..b8851777b 100644 --- a/cross/gcc-x86/0006-Enable-Wformat-and-Wformat-security-by-default.patch +++ b/cross/gcc-x86/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -1,15 +1,17 @@ -From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001 +From 35c02ea8267e193b92f30495c94ee1e8e5c2be8e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH] 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 75b6531860e..78830ce4b42 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -774,7 +774,7 @@ Warn about function calls with format strings that write past the end +@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end of the destination region. Wformat-security @@ -18,7 +20,7 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -799,7 +799,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -27,3 +29,6 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about printf/scanf/strftime/strfmon format string anomalies. Wframe-address +-- +2.50.1 + diff --git a/cross/gcc-x86/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-x86/0007-Enable-Wtrampolines-by-default.patch index 140685d7b..eda9ab096 100644 --- a/cross/gcc-x86/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-x86/0007-Enable-Wtrampolines-by-default.patch @@ -1,16 +1,18 @@ -From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/35] Enable -Wtrampolines by default. +From 0b82663fd2f054e07e116c4dcc5019f7e969cd3e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:44:20 -0700 +Subject: [PATCH] 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 bea1adc0940..e65a575d9f8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -811,7 +811,7 @@ Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers. +@@ -829,7 +829,7 @@ Common Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wa + Warn if a comparison always evaluates to true or false. Wtrampolines -Common Var(warn_trampolines) Warning @@ -18,3 +20,6 @@ Subject: [PATCH 07/35] Enable -Wtrampolines by default. Warn whenever a trampoline is generated. Wtrivial-auto-var-init +-- +2.50.1 + diff --git a/cross/gcc-x86/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/cross/gcc-x86/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch deleted file mode 100644 index e85284ff0..000000000 --- a/cross/gcc-x86/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and - -ffreestanding Change the buffer size. - ---- - gcc/gcc.cc | 8 +++++++- - gcc/params.opt | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1000,6 +1000,12 @@ proper position among the other output files. */ - #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" - #endif - -+#ifdef ENABLE_DEFAULT_SSP -+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " -+#else -+#define NO_SSP_SPEC "" -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1305,7 +1311,7 @@ static const char *cc1_options = - %{-version:--version}\ - %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ -- %{fsyntax-only:-o %j} %{-param*}\ -+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ - %{coverage:-fprofile-arcs -ftest-coverage}\ - %{fprofile-arcs|fcondition-coverage|fprofile-generate*|coverage:\ - %{!fprofile-update=single:\ ---- a/gcc/params.opt -+++ b/gcc/params.opt -@@ -1013,7 +1013,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim - The maximum number of SSA_NAME assignments to follow in determining a value. - - -param=ssp-buffer-size= --Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization -+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization - The lower bound for a buffer to be considered for stack smashing protection. - - -param=stack-clash-protection-guard-size= diff --git a/cross/gcc-x86/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch b/cross/gcc-x86/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch new file mode 100644 index 000000000..8997916ca --- /dev/null +++ b/cross/gcc-x86/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch @@ -0,0 +1,39 @@ +From 3acf32fc94fd447874b2f1447a19a65f0905bff5 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:49:03 -0700 +Subject: [PATCH] gcc: disable SSP on -ffreestanding, -nostdlib and + -nodefaultlibs + +--- + gcc/gcc.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9c7d15b04..7b0d3d2743b 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1009,6 +1009,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1314,7 +1320,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +-- +2.50.1 + diff --git a/cross/gcc-x86/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-x86/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch deleted file mode 100644 index f4dd52f19..000000000 --- a/cross/gcc-x86/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ /dev/null @@ -1,54 +0,0 @@ -From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during - gcc bootstrapping. - -Solves error messages like the following: - -msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) - -The libgcc_s.so used during build doesn't satisfy the needs of the -libstdc++.so that msgfmt is linked against. On the other hand, msgfmt -is used as a stand-alone application here, and what library it uses -behind the scenes is of no concern to the gcc build process. -Therefore, simply invoking it "as usual", i.e. without any special -library path, will make it work as expected here. - -2011-09-19 Martin von Gagern - -References: -https://bugs.gentoo.org/372377 -https://bugs.gentoo.org/295480 ---- - libstdc++-v3/po/Makefile.am | 1 + - libstdc++-v3/po/Makefile.in | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am -index 12d34910830..61b13762b71 100644 ---- a/libstdc++-v3/po/Makefile.am -+++ b/libstdc++-v3/po/Makefile.am -@@ -38,6 +38,7 @@ MSGFMT = msgfmt - EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) - - .po.mo: -+ env --unset=LD_LIBRARY_PATH \ - $(MSGFMT) -o $@ $< - - all-local: all-local-$(USE_NLS) -diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in -index 8e93445acd2..d6ff06e5ddb 100644 ---- a/libstdc++-v3/po/Makefile.in -+++ b/libstdc++-v3/po/Makefile.in -@@ -561,6 +561,7 @@ uninstall-am: - - - .po.mo: -+ env --unset=LD_LIBRARY_PATH \ - $(MSGFMT) -o $@ $< - - all-local: all-local-$(USE_NLS) --- -2.41.0 - diff --git a/cross/gcc-x86/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch b/cross/gcc-x86/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch new file mode 100644 index 000000000..8b25ba72d --- /dev/null +++ b/cross/gcc-x86/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch @@ -0,0 +1,25 @@ +From bb98973bdb5fe8bd040e238afe92845203929b59 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:50:42 -0700 +Subject: [PATCH] gcc: params: set default ssp-buffer-size to 4 + +--- + gcc/params.opt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/params.opt b/gcc/params.opt +index 64e453d29b7..bba3fd574f2 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -1064,7 +1064,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.50.1 + diff --git a/cross/gcc-x86/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-x86/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch deleted file mode 100644 index f56d41a57..000000000 --- a/cross/gcc-x86/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ /dev/null @@ -1,28 +0,0 @@ -From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/35] 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 1d5c779fcff..19e3cb1e31c 100644 ---- a/include/libiberty.h -+++ b/include/libiberty.h -@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *, - /* Like sprintf but provides a pointer to malloc'd storage, which must - be freed by the caller. */ - -+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ -+#ifndef asprintf - extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; - #endif -+#endif - - /* Like asprintf but allocates memory without fail. This works like - xmalloc. */ --- -2.41.0 - diff --git a/cross/gcc-x86/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-x86/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch new file mode 100644 index 000000000..c903a5cce --- /dev/null +++ b/cross/gcc-x86/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -0,0 +1,54 @@ +From f89d8e95b809d02eceee416b463200c9abb2b33e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:50:33 +0000 +Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc + bootstrapping. + +Solves error messages like the following: + +msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) + +The libgcc_s.so used during build doesn't satisfy the needs of the +libstdc++.so that msgfmt is linked against. On the other hand, msgfmt +is used as a stand-alone application here, and what library it uses +behind the scenes is of no concern to the gcc build process. +Therefore, simply invoking it "as usual", i.e. without any special +library path, will make it work as expected here. + +2011-09-19 Martin von Gagern + +References: +https://bugs.gentoo.org/372377 +https://bugs.gentoo.org/295480 +--- + libstdc++-v3/po/Makefile.am | 1 + + libstdc++-v3/po/Makefile.in | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am +index 7f84a99533e..a4c6284f788 100644 +--- a/libstdc++-v3/po/Makefile.am ++++ b/libstdc++-v3/po/Makefile.am +@@ -38,6 +38,7 @@ MSGFMT = msgfmt + EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) +diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in +index 8e93445acd2..d6ff06e5ddb 100644 +--- a/libstdc++-v3/po/Makefile.in ++++ b/libstdc++-v3/po/Makefile.in +@@ -561,6 +561,7 @@ uninstall-am: + + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) +-- +2.50.1 + diff --git a/cross/gcc-x86/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-x86/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch new file mode 100644 index 000000000..48b22a5dc --- /dev/null +++ b/cross/gcc-x86/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -0,0 +1,28 @@ +From b45303198567828a5240baf932a8c13255f35d20 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:52:07 +0000 +Subject: [PATCH] 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 d4e8791b14b..c074980ed80 100644 +--- a/include/libiberty.h ++++ b/include/libiberty.h +@@ -678,8 +678,11 @@ extern void *bsearch_r (const void *, const void *, + /* Like sprintf but provides a pointer to malloc'd storage, which must + be freed by the caller. */ + ++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ ++#ifndef asprintf + extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; + #endif ++#endif + + /* Like asprintf but allocates memory without fail. This works like + xmalloc. */ +-- +2.50.1 + diff --git a/cross/gcc-x86/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-x86/0011-libiberty-copy-PIC-objects-during-build-process.patch deleted file mode 100644 index b12d4f94b..000000000 --- a/cross/gcc-x86/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/35] 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 72608f3e4a7..58356884728 100644 ---- a/libiberty/Makefile.in -+++ b/libiberty/Makefile.in -@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) - $(AR) $(AR_FLAGS) $(TARGETLIB) \ - $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ - $(RANLIB) $(TARGETLIB); \ -+ cp $(TARGETLIB) ../ ; \ - cd ..; \ - else true; fi - --- -2.41.0 - diff --git a/cross/gcc-x86/0012-libgcc_s.patch b/cross/gcc-x86/0012-libgcc_s.patch deleted file mode 100644 index 8189f8491..000000000 --- a/cross/gcc-x86/0012-libgcc_s.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 12/35] libgcc_s - ---- - gcc/config/i386/i386-expand.cc | 4 ++-- - libgcc/config/i386/cpuinfo.c | 6 +++--- - libgcc/config/i386/t-linux | 2 +- - 3 files changed, 6 insertions(+), 6 deletions(-) - ---- a/gcc/config/i386/i386-expand.cc -+++ b/gcc/config/i386/i386-expand.cc -@@ -13089,10 +13089,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, - { - case IX86_BUILTIN_CPU_INIT: - { -- /* Make it call __cpu_indicator_init in libgcc. */ -+ /* Make it call __cpu_indicator_init in libgcc.a. */ - tree call_expr, fndecl, type; - type = build_function_type_list (integer_type_node, NULL_TREE); -- fndecl = build_fn_decl ("__cpu_indicator_init", type); -+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type); - call_expr = build_call_expr (fndecl, 0); - return expand_expr (call_expr, target, mode, EXPAND_NORMAL); - } ---- a/libgcc/config/i386/cpuinfo.c -+++ b/libgcc/config/i386/cpuinfo.c -@@ -63,7 +63,7 @@ __cpu_indicator_init (void) - __cpu_features2); - } - --#if defined SHARED && defined USE_ELF_SYMVER --__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); --__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); -+#ifndef SHARED -+int __cpu_indicator_init_local (void) -+ __attribute__ ((weak, alias ("__cpu_indicator_init"))); - #endif ---- a/libgcc/config/i386/t-linux -+++ b/libgcc/config/i386/t-linux -@@ -3,5 +3,5 @@ - # t-slibgcc-elf-ver and t-linux - SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver - --HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS) -+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) - CRTSTUFF_T_CFLAGS += $(CET_FLAGS) diff --git a/cross/gcc-x86/0012-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-x86/0012-libiberty-copy-PIC-objects-during-build-process.patch new file mode 100644 index 000000000..ff49be1c6 --- /dev/null +++ b/cross/gcc-x86/0012-libiberty-copy-PIC-objects-during-build-process.patch @@ -0,0 +1,24 @@ +From 68e2c9356221ba30b27840b9449f742505584cf1 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:53:00 +0000 +Subject: [PATCH] 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 ce54d88278d..10c212a1ad3 100644 +--- a/libiberty/Makefile.in ++++ b/libiberty/Makefile.in +@@ -266,6 +266,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + +-- +2.50.1 + diff --git a/cross/gcc-x86/0013-libgcc_s.patch b/cross/gcc-x86/0013-libgcc_s.patch new file mode 100644 index 000000000..99152585f --- /dev/null +++ b/cross/gcc-x86/0013-libgcc_s.patch @@ -0,0 +1,57 @@ +From ca482f8c9cac9617855f908dd30d3d6144e850a0 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Sat, 24 Oct 2015 20:09:53 +0000 +Subject: [PATCH] libgcc_s + +--- + gcc/config/i386/i386-expand.cc | 4 ++-- + libgcc/config/i386/cpuinfo.c | 6 +++--- + libgcc/config/i386/t-linux | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc +index cdfd94d3c73..a3a6c988833 100644 +--- a/gcc/config/i386/i386-expand.cc ++++ b/gcc/config/i386/i386-expand.cc +@@ -13643,10 +13643,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, + { + case IX86_BUILTIN_CPU_INIT: + { +- /* Make it call __cpu_indicator_init in libgcc. */ ++ /* Make it call __cpu_indicator_init in libgcc.a. */ + tree call_expr, fndecl, type; + type = build_function_type_list (integer_type_node, NULL_TREE); +- fndecl = build_fn_decl ("__cpu_indicator_init", type); ++ fndecl = build_fn_decl ("__cpu_indicator_init_local", type); + call_expr = build_call_expr (fndecl, 0); + return expand_expr (call_expr, target, mode, EXPAND_NORMAL); + } +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index 2484dc839bf..e980030ef23 100644 +--- a/libgcc/config/i386/cpuinfo.c ++++ b/libgcc/config/i386/cpuinfo.c +@@ -63,7 +63,7 @@ __cpu_indicator_init (void) + __cpu_features2); + } + +-#if defined SHARED && defined USE_ELF_SYMVER +-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); +-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); ++#ifndef SHARED ++int __cpu_indicator_init_local (void) ++ __attribute__ ((weak, alias ("__cpu_indicator_init"))); + #endif +diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux +index 8506a635790..564296f788e 100644 +--- a/libgcc/config/i386/t-linux ++++ b/libgcc/config/i386/t-linux +@@ -3,5 +3,5 @@ + # t-slibgcc-elf-ver and t-linux + SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver + +-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.50.1 + diff --git a/cross/gcc-x86/0013-nopie.patch b/cross/gcc-x86/0013-nopie.patch deleted file mode 100644 index 4a9ea0770..000000000 --- a/cross/gcc-x86/0013-nopie.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 13/35] nopie - ---- - gcc/configure | 25 +++++++++++++++++++++++++ - gcc/configure.ac | 11 +++++++++++ - 2 files changed, 36 insertions(+) - ---- a/gcc/configure -+++ b/gcc/configure -@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 - $as_echo "$gcc_cv_no_pie" >&6; } -+# Check if -nopie works. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5 -+$as_echo_n "checking for -nopie option... " >&6; } -+if ${gcc_cv_nopie+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ saved_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS -nopie" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+int main(void) {return 0;} -+_ACEOF -+if ac_fn_cxx_try_link "$LINENO"; then : -+ gcc_cv_nopie=yes -+else -+ gcc_cv_nopie=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ LDFLAGS="$saved_LDFLAGS" -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5 -+$as_echo "$gcc_cv_nopie" >&6; } - - if test x$enable_host_shared = xyes; then - PICFLAG=-fPIC -@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then - LD_PICFLAG=-pie - elif test x$gcc_cv_no_pie = xyes; then - LD_PICFLAG=-no-pie -+elif test x$gcc_cv_nopie = xyes; then -+ LD_PICFLAG=-nopie - else - LD_PICFLAG= - fi ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option], - [gcc_cv_no_pie=yes], - [gcc_cv_no_pie=no]) - LDFLAGS="$saved_LDFLAGS"]) -+# Check if -nopie works. -+AC_CACHE_CHECK([for -nopie option], -+ [gcc_cv_nopie], -+ [saved_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS -nopie" -+ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])], -+ [gcc_cv_nopie=yes], -+ [gcc_cv_nopie=no]) -+ LDFLAGS="$saved_LDFLAGS"]) - - if test x$enable_host_shared = xyes; then - PICFLAG=-fPIC -@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then - LD_PICFLAG=-pie - elif test x$gcc_cv_no_pie = xyes; then - LD_PICFLAG=-no-pie -+elif test x$gcc_cv_nopie = xyes; then -+ LD_PICFLAG=-nopie - else - LD_PICFLAG= - fi diff --git a/cross/gcc-x86/0014-ada-fix-shared-linking.patch b/cross/gcc-x86/0014-ada-fix-shared-linking.patch deleted file mode 100644 index ff6e42921..000000000 --- a/cross/gcc-x86/0014-ada-fix-shared-linking.patch +++ /dev/null @@ -1,42 +0,0 @@ -From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 14/35] 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 f2126441208..22cfa9c641f 100644 ---- a/gcc/ada/link.c -+++ b/gcc/ada/link.c -@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; - || defined (__NetBSD__) || defined (__OpenBSD__) \ - || defined (__QNX__) - const char *__gnat_object_file_option = "-Wl,@"; --const char *__gnat_run_path_option = "-Wl,-rpath,"; --char __gnat_shared_libgnat_default = STATIC; --char __gnat_shared_libgcc_default = STATIC; -+const char *__gnat_run_path_option = ""; -+char __gnat_shared_libgnat_default = SHARED; -+char __gnat_shared_libgcc_default = SHARED; - int __gnat_link_max = 8192; - unsigned char __gnat_objlist_file_supported = 1; - const char *__gnat_object_library_extension = ".a"; -@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; - - #elif defined (__linux__) || defined (__GLIBC__) - const char *__gnat_object_file_option = "-Wl,@"; --const char *__gnat_run_path_option = "-Wl,-rpath,"; --char __gnat_shared_libgnat_default = STATIC; --char __gnat_shared_libgcc_default = STATIC; -+const char *__gnat_run_path_option = ""; -+char __gnat_shared_libgnat_default = SHARED; -+char __gnat_shared_libgcc_default = SHARED; - int __gnat_link_max = 8192; - unsigned char __gnat_objlist_file_supported = 1; - const char *__gnat_object_library_extension = ".a"; --- -2.41.0 - diff --git a/cross/gcc-x86/0014-nopie.patch b/cross/gcc-x86/0014-nopie.patch new file mode 100644 index 000000000..7117a9434 --- /dev/null +++ b/cross/gcc-x86/0014-nopie.patch @@ -0,0 +1,85 @@ +From 6dfb241ae9f879f4945941273dd73eb13f127b06 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Sat, 7 Nov 2015 02:08:05 +0000 +Subject: [PATCH] nopie + +--- + gcc/configure | 25 +++++++++++++++++++++++++ + gcc/configure.ac | 11 +++++++++++ + 2 files changed, 36 insertions(+) + +diff --git a/gcc/configure b/gcc/configure +index 0f4a5d52c30..343563c8948 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -34586,6 +34586,29 @@ rm -f core conftest.err conftest.$ac_objext \ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 + $as_echo "$gcc_cv_no_pie" >&6; } ++# Check if -nopie works. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5 ++$as_echo_n "checking for -nopie option... " >&6; } ++if ${gcc_cv_nopie+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ saved_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -nopie" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++int main(void) {return 0;} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ gcc_cv_nopie=yes ++else ++ gcc_cv_nopie=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ LDFLAGS="$saved_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5 ++$as_echo "$gcc_cv_nopie" >&6; } + + if test x$enable_host_shared = xyes; then + PICFLAG=-fPIC +@@ -34603,6 +34626,8 @@ if test x$enable_host_pie = xyes; then + LD_PICFLAG=-pie + elif test x$gcc_cv_no_pie = xyes; then + LD_PICFLAG=-no-pie ++elif test x$gcc_cv_nopie = xyes; then ++ LD_PICFLAG=-nopie + else + LD_PICFLAG= + fi +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b0e3615e5aa..b3948469d17 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -7802,6 +7802,15 @@ AC_CACHE_CHECK([for -no-pie option], + [gcc_cv_no_pie=yes], + [gcc_cv_no_pie=no]) + LDFLAGS="$saved_LDFLAGS"]) ++# Check if -nopie works. ++AC_CACHE_CHECK([for -nopie option], ++ [gcc_cv_nopie], ++ [saved_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -nopie" ++ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])], ++ [gcc_cv_nopie=yes], ++ [gcc_cv_nopie=no]) ++ LDFLAGS="$saved_LDFLAGS"]) + + if test x$enable_host_shared = xyes; then + PICFLAG=-fPIC +@@ -7819,6 +7828,8 @@ if test x$enable_host_pie = xyes; then + LD_PICFLAG=-pie + elif test x$gcc_cv_no_pie = xyes; then + LD_PICFLAG=-no-pie ++elif test x$gcc_cv_nopie = xyes; then ++ LD_PICFLAG=-nopie + else + LD_PICFLAG= + fi +-- +2.50.1 + diff --git a/cross/gcc-x86/0015-ada-fix-shared-linking.patch b/cross/gcc-x86/0015-ada-fix-shared-linking.patch new file mode 100644 index 000000000..a893502b7 --- /dev/null +++ b/cross/gcc-x86/0015-ada-fix-shared-linking.patch @@ -0,0 +1,42 @@ +From 8ac6aeca5d6192ee16b959bd8c1903a52d408a55 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:59:16 +0000 +Subject: [PATCH] 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 9e3385ca94f..2c0cca6e480 100644 +--- a/gcc/ada/link.c ++++ b/gcc/ada/link.c +@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; + || defined (__NetBSD__) || defined (__OpenBSD__) \ + || defined (__QNX__) + const char *__gnat_object_file_option = "-Wl,@"; +-const char *__gnat_run_path_option = "-Wl,-rpath,"; +-char __gnat_shared_libgnat_default = STATIC; +-char __gnat_shared_libgcc_default = STATIC; ++const char *__gnat_run_path_option = ""; ++char __gnat_shared_libgnat_default = SHARED; ++char __gnat_shared_libgcc_default = SHARED; + int __gnat_link_max = 8192; + unsigned char __gnat_objlist_file_supported = 1; + const char *__gnat_object_library_extension = ".a"; +@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; + + #elif defined (__linux__) || defined (__GLIBC__) + const char *__gnat_object_file_option = "-Wl,@"; +-const char *__gnat_run_path_option = "-Wl,-rpath,"; +-char __gnat_shared_libgnat_default = STATIC; +-char __gnat_shared_libgcc_default = STATIC; ++const char *__gnat_run_path_option = ""; ++char __gnat_shared_libgnat_default = SHARED; ++char __gnat_shared_libgcc_default = SHARED; + int __gnat_link_max = 8192; + unsigned char __gnat_objlist_file_supported = 1; + const char *__gnat_object_library_extension = ".a"; +-- +2.50.1 + diff --git a/cross/gcc-x86/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-x86/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch deleted file mode 100644 index ddea4a05b..000000000 --- a/cross/gcc-x86/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing - ---- - Makefile.in | 1 + - 1 file changed, 1 insertion(+) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -179,6 +179,7 @@ BUILD_EXPORTS = \ - # built for the build system to override those in BASE_FLAGS_TO_PASS. - EXTRA_BUILD_FLAGS = \ - CFLAGS="$(CFLAGS_FOR_BUILD)" \ -+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ - LDFLAGS="$(LDFLAGS_FOR_BUILD)" - - # This is the list of directories to built for the host system. diff --git a/cross/gcc-x86/0016-add-fortify-headers-paths.patch b/cross/gcc-x86/0016-add-fortify-headers-paths.patch deleted file mode 100644 index b554e0251..000000000 --- a/cross/gcc-x86/0016-add-fortify-headers-paths.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 16/35] 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 e3aca79cccc..b3537b8fbeb 100644 ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -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 \ -+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \ -+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \ - { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ - { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, - #else --- -2.41.0 - diff --git a/cross/gcc-x86/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-x86/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch new file mode 100644 index 000000000..a6adebb1f --- /dev/null +++ b/cross/gcc-x86/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -0,0 +1,24 @@ +From 7323d68ae46fc8e33c0746799d820a4e4c8c8b72 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:59:43 +0000 +Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing + +--- + Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.in b/Makefile.in +index b1ed67d3d4f..1e039c20550 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -179,6 +179,7 @@ BUILD_EXPORTS = \ + # built for the build system to override those in BASE_FLAGS_TO_PASS. + EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + + # This is the list of directories to built for the host system. +-- +2.50.1 + diff --git a/cross/gcc-x86/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-x86/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch deleted file mode 100644 index 4796a055d..000000000 --- a/cross/gcc-x86/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Timo=20Ter=C3=A4s?= -Date: Fri, 21 Aug 2020 07:03:00 +0000 -Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We - link to it unconditionally, as otherwise we get link failures if some objects - are -fstack-protector built and final link happens with -fno-stack-protector. - This seems to be the common case when bootstrapping gcc, the piepatches do - not seem to fully fix the crosstoolchain and bootstrap sequence wrt. - stack-protector flag usage. - ---- - gcc/gcc.cc | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1008,8 +1008,7 @@ proper position among the other output files. */ - - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP --#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -- "|fstack-protector-strong|fstack-protector-explicit:}" -+#define LINK_SSP_SPEC "-lssp_nonshared" - #else - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit" \ diff --git a/cross/gcc-x86/0017-add-fortify-headers-paths.patch b/cross/gcc-x86/0017-add-fortify-headers-paths.patch new file mode 100644 index 000000000..b4ecd2fd5 --- /dev/null +++ b/cross/gcc-x86/0017-add-fortify-headers-paths.patch @@ -0,0 +1,25 @@ +From eaf89c8c91806905c6e1ec9519cbfb56296204b0 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:01:06 +0000 +Subject: [PATCH] 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 d6280a4d4dd..ba69fb9fad7 100644 +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -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 \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, + #else +-- +2.50.1 + diff --git a/cross/gcc-x86/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-x86/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch new file mode 100644 index 000000000..84731bb57 --- /dev/null +++ b/cross/gcc-x86/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -0,0 +1,31 @@ +From bdedcd9db7b8291637c5147dd82e8a9e3f5f9c87 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= +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. + This seems to be the common case when bootstrapping gcc, the piepatches do + not seem to fully fix the crosstoolchain and bootstrap sequence wrt. + stack-protector flag usage. + +--- + gcc/gcc.cc | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 7b0d3d2743b..e46e976a2e8 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1017,8 +1017,7 @@ proper position among the other output files. */ + + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP +-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +- "|fstack-protector-strong|fstack-protector-explicit:}" ++#define LINK_SSP_SPEC "-lssp_nonshared" + #else + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.50.1 + diff --git a/cross/gcc-x86/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-x86/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch deleted file mode 100644 index b829e5b34..000000000 --- a/cross/gcc-x86/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when - linking libtsan. - ---- - gcc/gcc.cc | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -772,10 +772,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 "}" \ -- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libasan:--push-state --no-as-needed}" \ - " -lasan " \ - " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libasan:--pop-state}" \ - STATIC_LIBASAN_LIBS - #else - #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -811,10 +811,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 "}" \ -- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libtsan:--push-state --no-as-needed}" \ - " -ltsan " \ - " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libtsan:--pop-state}" \ - STATIC_LIBTSAN_LIBS - #else - #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -832,10 +832,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 "}" \ -- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-liblsan:--push-state --no-as-needed}" \ - " -llsan " \ - " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-liblsan:--pop-state}" \ - STATIC_LIBLSAN_LIBS - #else - #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -851,10 +851,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 "}" \ -- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libubsan:--push-state --no-as-needed}" \ - " -lubsan " \ - " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libubsan:--pop-state}" \ - STATIC_LIBUBSAN_LIBS - #else - #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS diff --git a/cross/gcc-x86/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-x86/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch new file mode 100644 index 000000000..b703be7a7 --- /dev/null +++ b/cross/gcc-x86/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -0,0 +1,69 @@ +From 586ce3614d4fc3fbeccf01659114a4643c1879c8 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:03:42 +0000 +Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when + linking libtsan. + +--- + gcc/gcc.cc | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e46e976a2e8..607c8ca1d42 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -775,10 +775,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 "}" \ +- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libasan:--push-state --no-as-needed}" \ + " -lasan " \ + " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libasan:--pop-state}" \ + STATIC_LIBASAN_LIBS + #else + #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS +@@ -814,10 +814,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 "}" \ +- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libtsan:--push-state --no-as-needed}" \ + " -ltsan " \ + " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libtsan:--pop-state}" \ + STATIC_LIBTSAN_LIBS + #else + #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS +@@ -835,10 +835,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 "}" \ +- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-liblsan:--push-state --no-as-needed}" \ + " -llsan " \ + " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-liblsan:--pop-state}" \ + STATIC_LIBLSAN_LIBS + #else + #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS +@@ -854,10 +854,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 "}" \ +- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libubsan:--push-state --no-as-needed}" \ + " -lubsan " \ + " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libubsan:--pop-state}" \ + STATIC_LIBUBSAN_LIBS + #else + #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-x86/0019-aarch64-disable-multilib-support.patch b/cross/gcc-x86/0019-aarch64-disable-multilib-support.patch deleted file mode 100644 index 5a8148feb..000000000 --- a/cross/gcc-x86/0019-aarch64-disable-multilib-support.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:12:55 +0000 -Subject: [PATCH 19/35] aarch64: disable multilib support - -multilib is unsupported on Alpine GCC ---- - gcc/config/aarch64/t-aarch64-linux | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux -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 - LIB1ASMFUNCS = _aarch64_sync_cache_range - - AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) --MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) -+MULTILIB_OSDIRNAMES = mabi.lp64=../lib - 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.41.0 - diff --git a/cross/gcc-x86/0020-aarch64-disable-multilib-support.patch b/cross/gcc-x86/0020-aarch64-disable-multilib-support.patch new file mode 100644 index 000000000..f2ad4bd64 --- /dev/null +++ b/cross/gcc-x86/0020-aarch64-disable-multilib-support.patch @@ -0,0 +1,26 @@ +From 0ca7f92018d0bc04a72655f3b130c9aaeea1b771 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:12:55 +0000 +Subject: [PATCH] aarch64: disable multilib support + +multilib is unsupported on Alpine GCC +--- + gcc/config/aarch64/t-aarch64-linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux +index 70e36b3299e..e00c3becd3f 100644 +--- a/gcc/config/aarch64/t-aarch64-linux ++++ b/gcc/config/aarch64/t-aarch64-linux +@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = mabi.lp64=../lib + 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.50.1 + diff --git a/cross/gcc-x86/0020-s390x-disable-multilib-support.patch b/cross/gcc-x86/0020-s390x-disable-multilib-support.patch deleted file mode 100644 index ef2f449a4..000000000 --- a/cross/gcc-x86/0020-s390x-disable-multilib-support.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:13:59 +0000 -Subject: [PATCH 20/35] s390x: disable multilib support - -multilib is not supported on Alpine GCC at present ---- - gcc/config/s390/t-linux64 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64 -index cc6ab367072..7f498ee1cdc 100644 ---- a/gcc/config/s390/t-linux64 -+++ b/gcc/config/s390/t-linux64 -@@ -7,5 +7,5 @@ - - MULTILIB_OPTIONS = m64/m31 - MULTILIB_DIRNAMES = 64 32 --MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu) --MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 --- -2.41.0 - diff --git a/cross/gcc-x86/0021-ppc64-le-disable-multilib-support.patch b/cross/gcc-x86/0021-ppc64-le-disable-multilib-support.patch deleted file mode 100644 index dbdc78828..000000000 --- a/cross/gcc-x86/0021-ppc64-le-disable-multilib-support.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:14:33 +0000 -Subject: [PATCH 21/35] ppc64[le]: disable multilib support - -multilib is not presently supported on Alpine GCC ---- - gcc/config/rs6000/t-linux | 6 ++++-- - gcc/config/rs6000/t-linux64 | 4 ++-- - gcc/config/rs6000/t-linux64bele | 4 ++-- - gcc/config/rs6000/t-linux64lebe | 4 ++-- - 4 files changed, 10 insertions(+), 8 deletions(-) - -diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux -index 4e371255533..128c75c7d39 100644 ---- a/gcc/config/rs6000/t-linux -+++ b/gcc/config/rs6000/t-linux -@@ -2,7 +2,8 @@ - # or soft-float. - ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) - ifneq (,$(findstring powerpc64,$(target))) --MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - else - MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) - endif -@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target))) - MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) - endif - ifneq (,$(findstring powerpc64le,$(target))) --MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - endif - endif - -diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 -index 01a94242308..b3a76379c03 100644 ---- a/gcc/config/rs6000/t-linux64 -+++ b/gcc/config/rs6000/t-linux64 -@@ -28,8 +28,8 @@ - MULTILIB_OPTIONS := m64/m32 - MULTILIB_DIRNAMES := 64 32 - MULTILIB_EXTRA_OPTS := --MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) --MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - - rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc - $(COMPILE) $< -diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele -index 97c1ee6fb4d..08d72639cb6 100644 ---- a/gcc/config/rs6000/t-linux64bele -+++ b/gcc/config/rs6000/t-linux64bele -@@ -2,6 +2,6 @@ - - MULTILIB_OPTIONS += mlittle - MULTILIB_DIRNAMES += le --MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) --MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 - MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} -diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe -index 2e63bdb9fc9..c6e1c5db65d 100644 ---- a/gcc/config/rs6000/t-linux64lebe -+++ b/gcc/config/rs6000/t-linux64lebe -@@ -2,6 +2,6 @@ - - MULTILIB_OPTIONS += mbig - MULTILIB_DIRNAMES += be --MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) --MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} --- -2.41.0 - diff --git a/cross/gcc-x86/0021-s390x-disable-multilib-support.patch b/cross/gcc-x86/0021-s390x-disable-multilib-support.patch new file mode 100644 index 000000000..7b71aa3bc --- /dev/null +++ b/cross/gcc-x86/0021-s390x-disable-multilib-support.patch @@ -0,0 +1,25 @@ +From b48898c8fbd7828b81f407c74c25cf8e07fb73a4 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:13:59 +0000 +Subject: [PATCH] s390x: disable multilib support + +multilib is not supported on Alpine GCC at present +--- + gcc/config/s390/t-linux64 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64 +index cc6ab367072..7f498ee1cdc 100644 +--- a/gcc/config/s390/t-linux64 ++++ b/gcc/config/s390/t-linux64 +@@ -7,5 +7,5 @@ + + MULTILIB_OPTIONS = m64/m31 + MULTILIB_DIRNAMES = 64 32 +-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu) +-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 +-- +2.50.1 + diff --git a/cross/gcc-x86/0022-ppc64-le-disable-multilib-support.patch b/cross/gcc-x86/0022-ppc64-le-disable-multilib-support.patch new file mode 100644 index 000000000..5281a006c --- /dev/null +++ b/cross/gcc-x86/0022-ppc64-le-disable-multilib-support.patch @@ -0,0 +1,81 @@ +From 158d93ce86f3d311ce489d0740326027068ca721 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:14:33 +0000 +Subject: [PATCH] ppc64[le]: disable multilib support + +multilib is not presently supported on Alpine GCC +--- + gcc/config/rs6000/t-linux | 6 ++++-- + gcc/config/rs6000/t-linux64 | 4 ++-- + gcc/config/rs6000/t-linux64bele | 4 ++-- + gcc/config/rs6000/t-linux64lebe | 4 ++-- + 4 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux +index 4e371255533..128c75c7d39 100644 +--- a/gcc/config/rs6000/t-linux ++++ b/gcc/config/rs6000/t-linux +@@ -2,7 +2,8 @@ + # or soft-float. + ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) + ifneq (,$(findstring powerpc64,$(target))) +-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + else + MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) + endif +@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target))) + MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) + endif + ifneq (,$(findstring powerpc64le,$(target))) +-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + endif + endif + +diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 +index f56b47c268e..c5f757a6284 100644 +--- a/gcc/config/rs6000/t-linux64 ++++ b/gcc/config/rs6000/t-linux64 +@@ -28,8 +28,8 @@ + MULTILIB_OPTIONS := m64/m32 + MULTILIB_DIRNAMES := 64 32 + MULTILIB_EXTRA_OPTS := +-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) +-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + + rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc + $(COMPILE) $< +diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele +index 97c1ee6fb4d..08d72639cb6 100644 +--- a/gcc/config/rs6000/t-linux64bele ++++ b/gcc/config/rs6000/t-linux64bele +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mlittle + MULTILIB_DIRNAMES += le +-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe +index 2e63bdb9fc9..c6e1c5db65d 100644 +--- a/gcc/config/rs6000/t-linux64lebe ++++ b/gcc/config/rs6000/t-linux64lebe +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mbig + MULTILIB_DIRNAMES += be +-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +-- +2.50.1 + diff --git a/cross/gcc-x86/0022-x86_64-disable-multilib-support.patch b/cross/gcc-x86/0022-x86_64-disable-multilib-support.patch deleted file mode 100644 index 2b2f3e7f3..000000000 --- a/cross/gcc-x86/0022-x86_64-disable-multilib-support.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:14:54 +0000 -Subject: [PATCH 22/35] x86_64: disable multilib support - -multilib is not presently supported on Alpine GCC ---- - gcc/config/i386/t-linux64 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 -index 138956b0962..bc03dab874f 100644 ---- a/gcc/config/i386/t-linux64 -+++ b/gcc/config/i386/t-linux64 -@@ -33,6 +33,6 @@ - comma=, - MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) - MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) --MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) --MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 - MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) --- -2.41.0 - diff --git a/cross/gcc-x86/0023-riscv-disable-multilib-support.patch b/cross/gcc-x86/0023-riscv-disable-multilib-support.patch deleted file mode 100644 index eb9ba90fc..000000000 --- a/cross/gcc-x86/0023-riscv-disable-multilib-support.patch +++ /dev/null @@ -1,71 +0,0 @@ -From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Mon, 3 Jan 2022 07:14:48 +0100 -Subject: [PATCH 23/35] riscv: disable multilib support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From the musl wiki [1]: - - musl does not support sharing an include directory between archs - […], and thus is not compatible with GCC-style multilib. It is - recommended that distributions build GCC with multilib disabled, - and use library directories named lib, not lib64 or lib32. - -For this reason, we patch existing GCC configuration files (gcc/config) -to pin MULTILIB_OSDIRNAMES to lib, there is also a corresponding GCC -upstream bug about this issue [2]. Avoiding the use of lib64 and lib32 -directories is a bit more difficult on the RISC-V architecture. This is -due to the fact that the default RISC-V configuration does not only use -the lib64 and lib32 directories but also subdirectories within these -directories for different RISC-V ABIs (e.g. lp64d, lp64, …) [3]. - -This patch aligns the RISC-V configuration with other architectures by -pinning MULTILIB_OSDIRNAMES to lib for rv64gc (our default RISC-V --march). Furthermore, this patch removes the ABI-specific startfile -prefix spec. Since both of these impact the default LIBRARY_PATH [4] -this patch thereby aligns the default RISC-V LIBRARY_PATH with that from -other Alpine architectures and thereby fixes #13369 [5]. - -Incidentally, this also fixes gccgo on riscv64, as without this patch -gccgo is otherwise not able to find the *.gox files for the Go standard -library. - -[1]: https://wiki.musl-libc.org/guidelines-for-distributions.html#Multilib/multi_arch -[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077 -[3]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103889#c14 -[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122 -[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369 ---- - gcc/config/riscv/linux.h | 8 -------- - gcc/config/riscv/t-linux | 7 +++++-- - 2 files changed, 5 insertions(+), 10 deletions(-) - ---- a/gcc/config/riscv/linux.h -+++ b/gcc/config/riscv/linux.h -@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see - %{rdynamic:-export-dynamic} \ - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ - %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}" -- --#define STARTFILE_PREFIX_SPEC \ -- "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ -- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ -- "/lib/ " \ -- "/usr/lib/ " -- --#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi ---- a/gcc/config/riscv/t-linux -+++ b/gcc/config/riscv/t-linux -@@ -1,5 +1,8 @@ --# Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ --MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) -+MULTILIB_OPTIONS := march=rv64gc -+MULTILIB_DIRNAMES := rv64gc -+ -+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES))) - MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) -+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc - - MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) diff --git a/cross/gcc-x86/0023-x86_64-disable-multilib-support.patch b/cross/gcc-x86/0023-x86_64-disable-multilib-support.patch new file mode 100644 index 000000000..1e74e9462 --- /dev/null +++ b/cross/gcc-x86/0023-x86_64-disable-multilib-support.patch @@ -0,0 +1,26 @@ +From 6957fc21caca80f5e01db15df6dc8de46c85167b Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:14:54 +0000 +Subject: [PATCH] x86_64: disable multilib support + +multilib is not presently supported on Alpine GCC +--- + gcc/config/i386/t-linux64 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 +index 64a4a20e64f..9a8eb8dd8d1 100644 +--- a/gcc/config/i386/t-linux64 ++++ b/gcc/config/i386/t-linux64 +@@ -33,6 +33,6 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) +-- +2.50.1 + diff --git a/cross/gcc-x86/0024-always-build-libgcc_eh.a.patch b/cross/gcc-x86/0024-always-build-libgcc_eh.a.patch deleted file mode 100644 index 5d508ea08..000000000 --- a/cross/gcc-x86/0024-always-build-libgcc_eh.a.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 24/35] always build libgcc_eh.a - -highly inspired by: - http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch ---- - libgcc/Makefile.in | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -967,8 +967,9 @@ ifneq ($(LIBUNWIND),) - all: libunwind.a - endif - -+all: libgcc_eh.a - ifeq ($(enable_shared),yes) --all: libgcc_eh.a libgcc_s$(SHLIB_EXT) -+all: libgcc_s$(SHLIB_EXT) - ifneq ($(LIBUNWIND),) - all: libunwind$(SHLIB_EXT) - libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1173,10 +1174,6 @@ install-libunwind: - install-shared: - $(mkinstalldirs) $(DESTDIR)$(inst_libdir) - -- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ -- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a -- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a -- - $(subst @multilib_dir@,$(MULTIDIR),$(subst \ - @shlib_base_name@,libgcc_s,$(subst \ - @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -1193,6 +1190,10 @@ ifeq ($(enable_gcov),yes) - $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a - endif - -+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ -+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a -+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a -+ - parts="$(INSTALL_PARTS)"; \ - for file in $$parts; do \ - rm -f $(DESTDIR)$(inst_libdir)/$$file; \ diff --git a/cross/gcc-x86/0024-riscv-disable-multilib-support.patch b/cross/gcc-x86/0024-riscv-disable-multilib-support.patch new file mode 100644 index 000000000..cc136a04f --- /dev/null +++ b/cross/gcc-x86/0024-riscv-disable-multilib-support.patch @@ -0,0 +1,78 @@ +From fdcbe7ee4ce81cdf247966385c8d521ac3f5a38c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Mon, 3 Jan 2022 07:14:48 +0100 +Subject: [PATCH] riscv: disable multilib support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From the musl wiki [1]: + + musl does not support sharing an include directory between archs + […], and thus is not compatible with GCC-style multilib. It is + recommended that distributions build GCC with multilib disabled, + and use library directories named lib, not lib64 or lib32. + +For this reason, we patch existing GCC configuration files (gcc/config) +to pin MULTILIB_OSDIRNAMES to lib, there is also a corresponding GCC +upstream bug about this issue [2]. Avoiding the use of lib64 and lib32 +directories is a bit more difficult on the RISC-V architecture. This is +due to the fact that the default RISC-V configuration does not only use +the lib64 and lib32 directories but also subdirectories within these +directories for different RISC-V ABIs (e.g. lp64d, lp64, …) [3]. + +This patch aligns the RISC-V configuration with other architectures by +pinning MULTILIB_OSDIRNAMES to lib for rv64gc (our default RISC-V +-march). Furthermore, this patch removes the ABI-specific startfile +prefix spec. Since both of these impact the default LIBRARY_PATH [4] +this patch thereby aligns the default RISC-V LIBRARY_PATH with that from +other Alpine architectures and thereby fixes #13369 [5]. + +Incidentally, this also fixes gccgo on riscv64, as without this patch +gccgo is otherwise not able to find the *.gox files for the Go standard +library. + +[1]: https://wiki.musl-libc.org/guidelines-for-distributions.html#Multilib/multi_arch +[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077 +[3]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103889#c14 +[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122 +[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369 +--- + gcc/config/riscv/linux.h | 8 -------- + gcc/config/riscv/t-linux | 7 +++++-- + 2 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 282c77b6a7b..07adae3d59c 100644 +--- a/gcc/config/riscv/linux.h ++++ b/gcc/config/riscv/linux.h +@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see + %{rdynamic:-export-dynamic} \ + -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ + %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}" +- +-#define STARTFILE_PREFIX_SPEC \ +- "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ +- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ +- "/lib/ " \ +- "/usr/lib/ " +- +-#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi +diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux +index a6f64f88d25..f88776ec520 100644 +--- a/gcc/config/riscv/t-linux ++++ b/gcc/config/riscv/t-linux +@@ -1,5 +1,8 @@ +-# Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ +-MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) ++MULTILIB_OPTIONS := march=rv64gc ++MULTILIB_DIRNAMES := rv64gc ++ ++MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES))) + MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) ++MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc + + MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) +-- +2.50.1 + diff --git a/cross/gcc-x86/0025-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-x86/0025-ada-libgnarl-compatibility-for-musl.patch deleted file mode 100644 index b7c1c5f2f..000000000 --- a/cross/gcc-x86/0025-ada-libgnarl-compatibility-for-musl.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 25/35] ada: libgnarl compatibility for musl - ---- - gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ - gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- - 2 files changed, 3 insertions(+), 61 deletions(-) - -diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads -index 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 - PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; - -- function pthread_rwlockattr_setkind_np -- (attr : access pthread_rwlockattr_t; -- pref : int) return int; -- pragma Import -- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); -- - function pthread_rwlock_init - (mutex : access pthread_rwlock_t; - attr : access pthread_rwlockattr_t) return int; -@@ -470,11 +464,6 @@ package System.OS_Interface is - protocol : int) return int; - pragma Import (C, pthread_mutexattr_setprotocol); - -- function pthread_mutexattr_setprioceiling -- (attr : access pthread_mutexattr_t; -- prioceiling : int) return int; -- pragma Import (C, pthread_mutexattr_setprioceiling); -- - type struct_sched_param is record - 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 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 - pragma Import - (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); - -- function GNAT_has_cap_sys_nice return C.int; -- pragma Import -- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); - -- We do not have pragma Linker_Options ("-lcap"); here, because this - -- library is not present on many Linux systems. 'libcap' is the Linux - -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is - -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on - -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. - -- function Get_Ceiling_Support return Boolean; -- -- Get the value of the Ceiling_Support constant (see below). -- -- Note well: If this function or related code is modified, it should be -- -- tested by hand, because automated testing doesn't exercise it. -- -- ------------------------- -- -- Get_Ceiling_Support -- -- ------------------------- -- -- function Get_Ceiling_Support return Boolean is -- Ceiling_Support : Boolean := False; -- begin -- if Locking_Policy /= 'C' then -- return False; -- end if; -- -- declare -- function geteuid return Integer; -- pragma Import (C, geteuid, "geteuid"); -- Superuser : constant Boolean := geteuid = 0; -- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; -- pragma Assert (Has_Cap in 0 | 1); -- begin -- Ceiling_Support := Superuser or else Has_Cap = 1; -- end; -- -- return Ceiling_Support; -- end Get_Ceiling_Support; -- -- pragma Warnings (Off, "non-preelaborable call not allowed*"); -- Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-preelaborable call not allowed*"); - -- True if the locking policy is Ceiling_Locking, and the current process - -- has permission to use this policy. The process has permission if it is - -- running as 'root', or if the capability was set by the setcap command, -@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is - -- Init_Mutex -- - ---------------- - -+ pragma Warnings (Off, "formal parameter * is not referenced"); - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is -+ pragma Warnings (On, "formal parameter * is not referenced"); - Mutex_Attr : aliased pthread_mutexattr_t; - Result, Result_2 : C.int; - -@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is - return Result; - end if; - -- if Ceiling_Support then -- Result := pthread_mutexattr_setprotocol -- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); -- pragma Assert (Result = 0); -- -- Result := pthread_mutexattr_setprioceiling -- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); -- pragma Assert (Result = 0); -- -- elsif Locking_Policy = 'I' then -+ if Locking_Policy = 'I' then - Result := pthread_mutexattr_setprotocol - (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); - pragma Assert (Result = 0); -@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is - Result := pthread_rwlockattr_init (RWlock_Attr'Access); - pragma Assert (Result = 0); - -- Result := pthread_rwlockattr_setkind_np -- (RWlock_Attr'Access, -- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); -- pragma Assert (Result = 0); -- - Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); - - pragma Assert (Result in 0 | ENOMEM); --- -2.41.0 - diff --git a/cross/gcc-x86/0025-always-build-libgcc_eh.a.patch b/cross/gcc-x86/0025-always-build-libgcc_eh.a.patch new file mode 100644 index 000000000..5b21d4dd1 --- /dev/null +++ b/cross/gcc-x86/0025-always-build-libgcc_eh.a.patch @@ -0,0 +1,51 @@ +From 6f63901256443978a2c3746e72bd5762166a7790 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:05:41 +0000 +Subject: [PATCH] always build libgcc_eh.a + +highly inspired by: + http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch +--- + libgcc/Makefile.in | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index 0719fd0615d..80bb8f1622f 100644 +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -971,8 +971,9 @@ ifneq ($(LIBUNWIND),) + all: libunwind.a + endif + ++all: libgcc_eh.a + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1177,10 +1178,6 @@ install-libunwind: + install-shared: + $(mkinstalldirs) $(DESTDIR)$(inst_libdir) + +- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ +- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a +- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a +- + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) +@@ -1197,6 +1194,10 @@ ifeq ($(enable_gcov),yes) + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a + endif + ++ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a ++ + parts="$(INSTALL_PARTS)"; \ + for file in $$parts; do \ + rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.50.1 + diff --git a/cross/gcc-x86/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch b/cross/gcc-x86/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch new file mode 100644 index 000000000..e8fb24481 --- /dev/null +++ b/cross/gcc-x86/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch @@ -0,0 +1,59 @@ +From a365def37f5de93ad85588d8e2c02c0df28e88d6 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:09:02 -0700 +Subject: [PATCH] ada: libgnarl: remove use of glibc-specific + pthread_rwlockattr_setkind_np + +musl's thread library does not implement it + +Signed-off-by: Ariadne Conill +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 10 ---------- + gcc/ada/libgnarl/s-taprop__linux.adb | 7 ------- + 2 files changed, 17 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 7aeb15da523..5551b701e5a 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -402,16 +402,6 @@ package System.OS_Interface is + (attr : access pthread_rwlockattr_t) return int; + pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy"); + +- PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0; +- PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; +- +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb +index 8f4c835baa7..6df36c7d8f4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -409,16 +409,9 @@ package body System.Task_Primitives.Operations is + Result : C.int; + + begin +- -- Set the rwlock to prefer writer to avoid writers starvation +- + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); +-- +2.50.1 + diff --git a/cross/gcc-x86/0026-ada-musl-support-fixes.patch b/cross/gcc-x86/0026-ada-musl-support-fixes.patch deleted file mode 100644 index 0be683fa6..000000000 --- a/cross/gcc-x86/0026-ada-musl-support-fixes.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 26/35] ada: musl support fixes - ---- - gcc/ada/Makefile.rtl | 16 ++++++++-------- - gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- - gcc/ada/adaint.h | 10 ++++------ - gcc/ada/terminals.c | 8 ++++---- - 4 files changed, 35 insertions(+), 33 deletions(-) - ---- a/gcc/ada/Makefile.rtl -+++ b/gcc/ada/Makefile.rtl -@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) - s-intman.adb - #include - #endif -+ -+#if defined (linux) || defined(__linux__) -+#define _GNU_SOURCE 1 -+#include -+#endif - - #ifdef __PikeOS__ - #define __BSD_VISIBLE 1 -@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void) - #endif - - #if defined (__linux__) --#include - - /* glibc versions earlier than 2.7 do not define the routines to handle - dynamically allocated CPU sets. For these targets, we use the static -@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void) - - /* Dynamic cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count) - { - return CPU_ALLOC (count); -@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { -- CPU_FREE (set); -+ CPU_FREE ((cpu_set_t *) set); - } - - void --__gnat_cpu_zero (size_t count, cpu_set_t *set) -+__gnat_cpu_zero (size_t count, void *set) - { -- CPU_ZERO_S (count, set); -+ CPU_ZERO_S (count, (cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET_S (cpu - 1, count, set); -+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); - } - - #else /* !CPU_ALLOC */ - - /* Static cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) - { -- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); -+ return xmalloc (sizeof (cpu_set_t)); - } - - size_t -@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { - free (set); - } - - void --__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) - { -- CPU_ZERO (set); -+ CPU_ZERO ((cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET (cpu - 1, set); -+ CPU_SET (cpu - 1, (cpu_set_t *) set); - } - #endif /* !CPU_ALLOC */ - #endif /* __linux__ */ ---- a/gcc/ada/adaint.h -+++ b/gcc/ada/adaint.h -@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void); - - /* Routines for interface to required CPU set primitives */ - --#include -- --extern cpu_set_t *__gnat_cpu_alloc (size_t); -+extern void * __gnat_cpu_alloc (size_t); - extern size_t __gnat_cpu_alloc_size (size_t); --extern void __gnat_cpu_free (cpu_set_t *); --extern void __gnat_cpu_zero (size_t, cpu_set_t *); --extern void __gnat_cpu_set (int, size_t, cpu_set_t *); -+extern void __gnat_cpu_free (void *); -+extern void __gnat_cpu_zero (size_t, void *); -+extern void __gnat_cpu_set (int, size_t, void *); - #endif - - #if defined (_WIN32) ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1134,7 +1134,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) -- 2- getpt (USE_GETPT) -+ 2- posix_openpt (USE_POSIX_OPENPT) - 3- openpty (USE_OPENPTY) - - When using the cloning device method, the macro USE_CLONE_DEVICE should -@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, - #if defined (__APPLE__) || defined (BSD) - #define USE_OPENPTY - #elif defined (__linux__) --#define USE_GETPT -+#define USE_POSIX_OPENPT - #elif defined (__sun__) - #define USE_CLONE_DEVICE "/dev/ptmx" - #elif defined (_AIX) -@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { - int master_fd = -1; - char *slave_name = NULL; - --#ifdef USE_GETPT -- master_fd = getpt (); -+#if defined(USE_POSIX_OPENPT) -+ master_fd = posix_openpt(O_RDWR | O_NOCTTY); - #elif defined (USE_OPENPTY) - status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); - #elif defined (USE_CLONE_DEVICE) diff --git a/cross/gcc-x86/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch b/cross/gcc-x86/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch new file mode 100644 index 000000000..c138a6034 --- /dev/null +++ b/cross/gcc-x86/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch @@ -0,0 +1,50 @@ +From e1572457f94a26da9a588a36afa3eb0e74122c34 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:13:19 -0700 +Subject: [PATCH] ada: libgnarl: use posix_openpt instead of glibc-specific + getpt to open a pty + +musl only implements posix_openpt(3), not the older glibc-specific getpt() +and glibc implements both for ages. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/terminals.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index 89f887556c0..93557fe2631 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1134,7 +1134,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) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + #if defined (__APPLE__) || defined (BSD) + #define USE_OPENPTY + #elif defined (__linux__) +-#define USE_GETPT ++#define USE_POSIX_OPENPT + #elif defined (__sun__) + #define USE_CLONE_DEVICE "/dev/ptmx" + #elif defined (_AIX) +@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) +-- +2.50.1 + diff --git a/cross/gcc-x86/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-x86/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch deleted file mode 100644 index 0b92854c4..000000000 --- a/cross/gcc-x86/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +++ /dev/null @@ -1,235 +0,0 @@ -From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001 -From: Drew DeVault -Date: Wed, 9 Dec 2020 07:42:06 +0000 -Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in - LINK_GCC_C_SEQUENCE_SPEC [PR81358] - -This fixes issues with RISC-V. ---- - Makefile.in | 1 + - gcc/config/gnu-user.h | 12 +++++++++++- - gcc/config.in | 6 ++++++ - 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(+), 5 deletions(-) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -237,6 +237,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; \ -+ TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \ - HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ - GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ - GMPINC="$(HOST_GMPINC)"; export GMPINC; \ ---- 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 - #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " - #endif - -+#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) -+# ifdef LD_AS_NEEDED_OPTION -+# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION -+# else -+# define LINK_LIBATOMIC_SPEC "-latomic" -+# endif -+#elif !defined(LINK_LIBATOMIC_SPEC) -+# define LINK_LIBATOMIC_SPEC "" -+#endif -+ - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ -- "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ -+ "%{static|static-pie:--start-group} %G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L} \ - %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" - - #undef LINK_GCC_C_SEQUENCE_SPEC ---- a/gcc/config.in -+++ b/gcc/config.in -@@ -131,6 +131,12 @@ - #endif - - -+/* Define if libatomic should always be linked. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_AUTOLINK_LIBATOMIC -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET ---- a/gcc/configure -+++ b/gcc/configure -@@ -1002,6 +1002,7 @@ with_changes_root_url - enable_languages - with_multilib_list - with_multilib_generator -+enable_autolink_libatomic - with_zstd - with_zstd_include - with_zstd_lib -@@ -1739,6 +1740,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 -+ --enable-autolink-libatomic -+ enable automatic linking of libatomic (ignored if -+ not built) - --disable-rpath do not hardcode runtime library paths - --enable-sjlj-exceptions - arrange to use setjmp/longjmp exception handling -@@ -8380,7 +8384,6 @@ else - fi - - -- - # Check whether --with-multilib-generator was given. - if test "${with_multilib_generator+set}" = set; then : - withval=$with_multilib_generator; : -@@ -8388,6 +8391,32 @@ else - with_multilib_generator=default - fi - -+# If libatomic is available, whether it should be linked automatically -+# Check whether --enable-autolink-libatomic was given. -+if test "${enable_autolink_libatomic+set}" = set; then : -+ enableval=$enable_autolink_libatomic; -+ case $enable_autolink_libatomic in -+ yes | no) ;; -+ *) as_fn_error $? "'$enable_autolink_libatomic' is an invalid value for -+--enable-autolink-libatomic. Valid choices are 'yes' and 'no'." "$LINENO" 5 ;; -+ esac -+ -+else -+ enable_autolink_libatomic='' -+fi -+ -+ -+if test x$enable_autolink_libatomic = xyes; then -+ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then -+ -+$as_echo "#define ENABLE_AUTOLINK_LIBATOMIC 1" >>confdefs.h -+ -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&5 -+$as_echo "$as_me: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&2;} -+ fi -+fi -+ - - # ------------------------- - # Checks for other programs ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -1215,6 +1215,27 @@ AC_ARG_WITH(multilib-generator, - :, - with_multilib_generator=default) - -+# If libatomic is available, whether it should be linked automatically -+AC_ARG_ENABLE(autolink-libatomic, -+[AS_HELP_STRING([--enable-autolink-libatomic], -+ [enable automatic linking of libatomic (ignored if not built)])], -+[ -+ case $enable_autolink_libatomic in -+ yes | no) ;; -+ *) AC_MSG_ERROR(['$enable_autolink_libatomic' is an invalid value for -+--enable-autolink-libatomic. Valid choices are 'yes' and 'no'.]) ;; -+ esac -+], [enable_autolink_libatomic='']) -+ -+if test x$enable_autolink_libatomic = xyes; then -+ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then -+ AC_DEFINE(ENABLE_AUTOLINK_LIBATOMIC, 1, -+ [Define if libatomic should always be linked.]) -+ else -+ AC_MSG_WARN([libatomic is not build for this target, --enable-autolink-libatomic ignored]) -+ fi -+fi -+ - # ------------------------- - # Checks for other programs - # ------------------------- ---- a/gcc/doc/install.texi -+++ b/gcc/doc/install.texi -@@ -2525,6 +2525,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}. - -+@item --enable-autolink-libatomic -+@itemx --disable-autolink-libatomic -+Tell GCC that it should automatically link libatomic; if supported by -+the linker, the file is only linked as needed. This flag is ignored -+when libatomic is not built. Note that this conigure flag is in particular -+useful when building an offloading-target compiler; as for those, a -+user had to specify @code{-foffload=target=-latomic} otherwise. -+ - @item --with-glibc-version=@var{major}.@var{minor} - 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 ---- a/gcc/doc/tm.texi -+++ b/gcc/doc/tm.texi -@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. - - @defmac LINK_GCC_C_SEQUENCE_SPEC - The sequence in which libgcc and libc are specified to the linker. --By default this is @code{%G %L %G}. -+By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. -+@end defmac -+ -+@defmac LINK_LIBATOMIC_SPEC -+This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link -+libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} -+is set. - @end defmac - - @defmac POST_LINK_SPEC ---- a/gcc/doc/tm.texi.in -+++ b/gcc/doc/tm.texi.in -@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. - - @defmac LINK_GCC_C_SEQUENCE_SPEC - The sequence in which libgcc and libc are specified to the linker. --By default this is @code{%G %L %G}. -+By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. -+@end defmac -+ -+@defmac LINK_LIBATOMIC_SPEC -+This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link -+libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} -+is set. - @end defmac - - @defmac POST_LINK_SPEC ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -991,13 +991,23 @@ proper position among the other output files. */ - # define ASM_DEBUG_OPTION_SPEC "" - #endif - -+#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) -+# ifdef LD_AS_NEEDED_OPTION -+# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION -+# else -+# define LINK_LIBATOMIC_SPEC "-latomic" -+# endif -+#elif !defined(LINK_LIBATOMIC_SPEC) -+# define LINK_LIBATOMIC_SPEC "" -+#endif -+ - /* Here is the spec for running the linker, after compiling all files. */ - - /* This is overridable by the target in case they need to specify the - -lgcc and -lc order specially, yet not require them to override all - of LINK_COMMAND_SPEC. */ - #ifndef LINK_GCC_C_SEQUENCE_SPEC --#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" -+#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L %G}" - #endif - - #ifdef ENABLE_DEFAULT_SSP diff --git a/cross/gcc-x86/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch b/cross/gcc-x86/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch new file mode 100644 index 000000000..0bf61bd9f --- /dev/null +++ b/cross/gcc-x86/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch @@ -0,0 +1,54 @@ +From 4f26d4bfedb7f942b69ca4743f053c3a690a0b4a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:18:49 -0700 +Subject: [PATCH] ada: libgnarl: adaint: fix sched.h inclusion for musl + +Signed-off-by: Ariadne Conill +--- + gcc/ada/adaint.c | 6 +++++- + gcc/ada/adaint.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 1fcfae165a7..67318e647ed 100644 +--- a/gcc/ada/adaint.c ++++ b/gcc/ada/adaint.c +@@ -95,6 +95,11 @@ + #include + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 + #endif +@@ -3476,7 +3481,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 3df12b5f956..26a489f2b78 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -40,6 +40,11 @@ extern "C" { + #include "mingw32.h" + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #include + + /* Constants used for the form parameter encoding values */ +-- +2.50.1 + diff --git a/cross/gcc-x86/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-x86/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch deleted file mode 100644 index f92fc7bf4..000000000 --- a/cross/gcc-x86/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Sun, 29 Aug 2021 12:23:34 +0200 -Subject: [PATCH 28/35] 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 -which builtins are available on riscv64. This then causes incorrect code -generation for libatomic since it assumes compiler builtins to be -available which are not actually available on riscv64. - -This commit fixes this issue by disabling linking of libatomic configure -test code entirely, thereby preventing linking against libatomic. - -See: - -* https://gitlab.alpinelinux.org/alpine/aports/-/issues/12948 -* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c6 ---- - libatomic/configure.tgt | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index a92ae9e8309..90b579ca4d8 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -30,6 +30,26 @@ - # on ${target_cpu}. For example to allow proper use of multilibs. - configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" - -+# The libatomic configure script performs several checks to determine -+# whether builtins for atomic operations are available. When compiling -+# with --enable-autolink-libatomic the test code compiled by the -+# configure script is also linked against libatomic. This causes it -+# to think that builtins are available, even if there are not, since -+# the tested symbols are provided by libatomic. -+# -+# This is a hack to ensure that we don't link against libatomic by not -+# linking any configure test code at all when --enable-autolink-libatomic -+# is given. -+# -+# See: -+# -+# * https://gitlab.alpinelinux.org/alpine/aports/-/issues/12817 -+# * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c4 -+# -+if test x$enable_autolink_libatomic = xyes; then -+ gcc_no_link=yes -+fi -+ - case "${target_cpu}" in - alpha*) - # fenv.c needs this option to generate inexact exceptions. --- -2.41.0 - diff --git a/cross/gcc-x86/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-x86/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch new file mode 100644 index 000000000..32c8c8724 --- /dev/null +++ b/cross/gcc-x86/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch @@ -0,0 +1,256 @@ +From 6592e702844d31bcef17c340bfc13e0e1be9f132 Mon Sep 17 00:00:00 2001 +From: Drew DeVault +Date: Wed, 9 Dec 2020 07:42:06 +0000 +Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in + LINK_GCC_C_SEQUENCE_SPEC [PR81358] + +This fixes issues with RISC-V. +--- + Makefile.in | 1 + + gcc/config.in | 6 ++++++ + gcc/config/gnu-user.h | 12 +++++++++++- + 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(+), 5 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 1e039c20550..20f535a306a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -238,6 +238,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; \ ++ TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \ + HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ + GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ + GMPINC="$(HOST_GMPINC)"; export GMPINC; \ +diff --git a/gcc/config.in b/gcc/config.in +index 8a531ed591c..40045ff35a5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -131,6 +131,12 @@ + #endif + + ++/* Define if libatomic should always be linked. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_AUTOLINK_LIBATOMIC ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 3c17ac6eade..0426efdb8c3 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 + #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " + #endif + ++#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) ++# ifdef LD_AS_NEEDED_OPTION ++# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION ++# else ++# define LINK_LIBATOMIC_SPEC "-latomic" ++# endif ++#elif !defined(LINK_LIBATOMIC_SPEC) ++# define LINK_LIBATOMIC_SPEC "" ++#endif ++ + #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ +- "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ ++ "%{static|static-pie:--start-group} %G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L} \ + %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" + + #undef LINK_GCC_C_SEQUENCE_SPEC +diff --git a/gcc/configure b/gcc/configure +index 343563c8948..54300a2a867 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -1003,6 +1003,7 @@ with_changes_root_url + enable_languages + with_multilib_list + with_multilib_generator ++enable_autolink_libatomic + with_zstd + with_zstd_include + with_zstd_lib +@@ -1742,6 +1743,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 ++ --enable-autolink-libatomic ++ enable automatic linking of libatomic (ignored if ++ not built) + --disable-rpath do not hardcode runtime library paths + --enable-sjlj-exceptions + arrange to use setjmp/longjmp exception handling +@@ -8400,7 +8404,6 @@ else + fi + + +- + # Check whether --with-multilib-generator was given. + if test "${with_multilib_generator+set}" = set; then : + withval=$with_multilib_generator; : +@@ -8408,6 +8411,32 @@ else + with_multilib_generator=default + fi + ++# If libatomic is available, whether it should be linked automatically ++# Check whether --enable-autolink-libatomic was given. ++if test "${enable_autolink_libatomic+set}" = set; then : ++ enableval=$enable_autolink_libatomic; ++ case $enable_autolink_libatomic in ++ yes | no) ;; ++ *) as_fn_error $? "'$enable_autolink_libatomic' is an invalid value for ++--enable-autolink-libatomic. Valid choices are 'yes' and 'no'." "$LINENO" 5 ;; ++ esac ++ ++else ++ enable_autolink_libatomic='' ++fi ++ ++ ++if test x$enable_autolink_libatomic = xyes; then ++ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then ++ ++$as_echo "#define ENABLE_AUTOLINK_LIBATOMIC 1" >>confdefs.h ++ ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&5 ++$as_echo "$as_me: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&2;} ++ fi ++fi ++ + + # ------------------------- + # Checks for other programs +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b3948469d17..81c070830e2 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1227,6 +1227,27 @@ AC_ARG_WITH(multilib-generator, + :, + with_multilib_generator=default) + ++# If libatomic is available, whether it should be linked automatically ++AC_ARG_ENABLE(autolink-libatomic, ++[AS_HELP_STRING([--enable-autolink-libatomic], ++ [enable automatic linking of libatomic (ignored if not built)])], ++[ ++ case $enable_autolink_libatomic in ++ yes | no) ;; ++ *) AC_MSG_ERROR(['$enable_autolink_libatomic' is an invalid value for ++--enable-autolink-libatomic. Valid choices are 'yes' and 'no'.]) ;; ++ esac ++], [enable_autolink_libatomic='']) ++ ++if test x$enable_autolink_libatomic = xyes; then ++ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then ++ AC_DEFINE(ENABLE_AUTOLINK_LIBATOMIC, 1, ++ [Define if libatomic should always be linked.]) ++ else ++ AC_MSG_WARN([libatomic is not build for this target, --enable-autolink-libatomic ignored]) ++ fi ++fi ++ + # ------------------------- + # Checks for other programs + # ------------------------- +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 3e9e09b4ae3..6e7b756be61 100644 +--- a/gcc/doc/install.texi ++++ b/gcc/doc/install.texi +@@ -2617,6 +2617,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}. + ++@item --enable-autolink-libatomic ++@itemx --disable-autolink-libatomic ++Tell GCC that it should automatically link libatomic; if supported by ++the linker, the file is only linked as needed. This flag is ignored ++when libatomic is not built. Note that this conigure flag is in particular ++useful when building an offloading-target compiler; as for those, a ++user had to specify @code{-foffload=target=-latomic} otherwise. ++ + @item --with-glibc-version=@var{major}.@var{minor} + 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 a96700c0d38..16deedca64d 100644 +--- a/gcc/doc/tm.texi ++++ b/gcc/doc/tm.texi +@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. + + @defmac LINK_GCC_C_SEQUENCE_SPEC + The sequence in which libgcc and libc are specified to the linker. +-By default this is @code{%G %L %G}. ++By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. ++@end defmac ++ ++@defmac LINK_LIBATOMIC_SPEC ++This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link ++libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} ++is set. + @end defmac + + @defmac POST_LINK_SPEC +diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in +index eccc4d88493..4ca4c610571 100644 +--- a/gcc/doc/tm.texi.in ++++ b/gcc/doc/tm.texi.in +@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. + + @defmac LINK_GCC_C_SEQUENCE_SPEC + The sequence in which libgcc and libc are specified to the linker. +-By default this is @code{%G %L %G}. ++By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. ++@end defmac ++ ++@defmac LINK_LIBATOMIC_SPEC ++This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link ++libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} ++is set. + @end defmac + + @defmac POST_LINK_SPEC +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 607c8ca1d42..e9f78f0f4c1 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1000,13 +1000,23 @@ proper position among the other output files. */ + # define ASM_DEBUG_OPTION_SPEC "" + #endif + ++#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) ++# ifdef LD_AS_NEEDED_OPTION ++# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION ++# else ++# define LINK_LIBATOMIC_SPEC "-latomic" ++# endif ++#elif !defined(LINK_LIBATOMIC_SPEC) ++# define LINK_LIBATOMIC_SPEC "" ++#endif ++ + /* Here is the spec for running the linker, after compiling all files. */ + + /* This is overridable by the target in case they need to specify the + -lgcc and -lc order specially, yet not require them to override all + of LINK_COMMAND_SPEC. */ + #ifndef LINK_GCC_C_SEQUENCE_SPEC +-#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" ++#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L %G}" + #endif + + #ifdef ENABLE_DEFAULT_SSP +-- +2.50.1 + diff --git a/cross/gcc-x86/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-x86/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch deleted file mode 100644 index 4418cd5b5..000000000 --- a/cross/gcc-x86/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001 -From: Samuel Holland -Date: Thu, 30 Jun 2022 16:44:51 +0000 -Subject: [PATCH 29/35] 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 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 - // Currently, the generic model only supports the "C" locale. - // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html - __cloc = 0; -- if (strcmp(__s, "C")) -- __throw_runtime_error(__N("locale::facet::_S_create_c_locale " -- "name not valid")); - } - - void --- -2.41.0 - diff --git a/cross/gcc-x86/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-x86/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch new file mode 100644 index 000000000..5aed9caf5 --- /dev/null +++ b/cross/gcc-x86/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -0,0 +1,57 @@ +From 952070c1616f231a810af2da50264713d7587b48 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sun, 29 Aug 2021 12:23:34 +0200 +Subject: [PATCH] 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 +which builtins are available on riscv64. This then causes incorrect code +generation for libatomic since it assumes compiler builtins to be +available which are not actually available on riscv64. + +This commit fixes this issue by disabling linking of libatomic configure +test code entirely, thereby preventing linking against libatomic. + +See: + +* https://gitlab.alpinelinux.org/alpine/aports/-/issues/12948 +* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c6 +--- + libatomic/configure.tgt | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt +index 6db039d6e8b..2751b5c1387 100644 +--- a/libatomic/configure.tgt ++++ b/libatomic/configure.tgt +@@ -30,6 +30,26 @@ + # on ${target_cpu}. For example to allow proper use of multilibs. + configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" + ++# The libatomic configure script performs several checks to determine ++# whether builtins for atomic operations are available. When compiling ++# with --enable-autolink-libatomic the test code compiled by the ++# configure script is also linked against libatomic. This causes it ++# to think that builtins are available, even if there are not, since ++# the tested symbols are provided by libatomic. ++# ++# This is a hack to ensure that we don't link against libatomic by not ++# linking any configure test code at all when --enable-autolink-libatomic ++# is given. ++# ++# See: ++# ++# * https://gitlab.alpinelinux.org/alpine/aports/-/issues/12817 ++# * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c4 ++# ++if test x$enable_autolink_libatomic = xyes; then ++ gcc_no_link=yes ++fi ++ + case "${target_cpu}" in + alpha*) + # fenv.c needs this option to generate inexact exceptions. +-- +2.50.1 + diff --git a/cross/gcc-x86/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-x86/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch deleted file mode 100644 index fde874c35..000000000 --- a/cross/gcc-x86/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001 -From: Mathias LANG -Date: Mon, 17 Jan 2022 03:49:21 +0000 -Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against - libucontext - -ref: alpine/aports#13422 ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -54362,7 +54362,7 @@ configure-target-libphobos: - esac; \ - module_srcdir=libphobos; \ - rm -f no-such-file || : ; \ -- CONFIG_SITE=no-such-file $(SHELL) \ -+ CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \ - $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ diff --git a/cross/gcc-x86/0031-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-x86/0031-druntime-link-against-libucontext-on-all-platforms.patch deleted file mode 100644 index 72f9370ee..000000000 --- a/cross/gcc-x86/0031-druntime-link-against-libucontext-on-all-platforms.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Sat, 16 Jul 2022 09:21:11 +0200 -Subject: [PATCH 31/35] druntime: link against libucontext on all platforms - -On musl-based Linux distributions, swapcontext etc. are not provided by -musl but instead by libucontext. Hence, we _always_ need to link against -an external library for these functions. ---- - libphobos/configure | 8 -------- - libphobos/m4/druntime/libraries.m4 | 8 -------- - 2 files changed, 16 deletions(-) - ---- a/libphobos/configure -+++ b/libphobos/configure -@@ -15375,14 +15375,6 @@ fi - # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to - # "yes" for targets that have 'version = AsmExternal'. - druntime_fiber_asm_external=no -- case "$target_cpu" in -- aarch64* | \ -- arm* | \ -- i[34567]86|x86_64 | \ -- powerpc) -- druntime_fiber_asm_external=yes -- ;; -- esac - if test "$druntime_fiber_asm_external" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 - $as_echo_n "checking for library containing swapcontext... " >&6; } ---- a/libphobos/m4/druntime/libraries.m4 -+++ b/libphobos/m4/druntime/libraries.m4 -@@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], - # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to - # "yes" for targets that have 'version = AsmExternal'. - druntime_fiber_asm_external=no -- case "$target_cpu" in -- aarch64* | \ -- arm* | \ -- i[[34567]]86|x86_64 | \ -- powerpc) -- druntime_fiber_asm_external=yes -- ;; -- esac - if test "$druntime_fiber_asm_external" = no; then - AC_SEARCH_LIBS([swapcontext], [c ucontext], [], - AC_MSG_ERROR([swapcontext required but not found])) diff --git a/cross/gcc-x86/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-x86/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch new file mode 100644 index 000000000..2b7259a4d --- /dev/null +++ b/cross/gcc-x86/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch @@ -0,0 +1,27 @@ +From 896b002a2afacb4d75d573aca4ae53b499df19cd Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Thu, 30 Jun 2022 16:44:51 +0000 +Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl + targets + +--- + libstdc++-v3/config/locale/generic/c_locale.cc | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc +index bfd02b5c2c6..16f9e84d66f 100644 +--- a/libstdc++-v3/config/locale/generic/c_locale.cc ++++ b/libstdc++-v3/config/locale/generic/c_locale.cc +@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Currently, the generic model only supports the "C" locale. + // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html + __cloc = 0; +- if (strcmp(__s, "C")) +- __throw_runtime_error(__N("locale::facet::_S_create_c_locale " +- "name not valid")); + } + + void +-- +2.50.1 + diff --git a/cross/gcc-x86/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-x86/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch new file mode 100644 index 000000000..452ced2ee --- /dev/null +++ b/cross/gcc-x86/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch @@ -0,0 +1,26 @@ +From 22d69ae3e2768d301ef5a1f1b362c25cf8bf27b9 Mon Sep 17 00:00:00 2001 +From: Mathias LANG +Date: Mon, 17 Jan 2022 03:49:21 +0000 +Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext + +ref: alpine/aports#13422 +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 20f535a306a..c087bfe7cd4 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -54382,7 +54382,7 @@ configure-target-libphobos: + esac; \ + module_srcdir=libphobos; \ + rm -f no-such-file || : ; \ +- CONFIG_SITE=no-such-file $(SHELL) \ ++ CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \ + $$s/$$module_srcdir/configure \ + --srcdir=$${topdir}/$$module_srcdir \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.50.1 + diff --git a/cross/gcc-x86/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-x86/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch deleted file mode 100644 index b53e5847d..000000000 --- a/cross/gcc-x86/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +++ /dev/null @@ -1,20 +0,0 @@ -From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Tue, 19 Jul 2022 14:54:07 +0200 -Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc - ---- - gcc/ada/libgnat/s-parame.ads | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/gcc/ada/libgnat/s-parame.ads -+++ b/gcc/ada/libgnat/s-parame.ads -@@ -100,7 +100,7 @@ package System.Parameters is - -- Characteristics of time_t type -- - ------------------------------------ - -- time_t_bits : constant := Long_Integer'Size; -+ time_t_bits : constant := Long_Long_Integer'Size; - -- Number of bits in type time_t - - ---------------------------------------------- diff --git a/cross/gcc-x86/0033-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-x86/0033-druntime-link-against-libucontext-on-all-platforms.patch new file mode 100644 index 000000000..920cf677e --- /dev/null +++ b/cross/gcc-x86/0033-druntime-link-against-libucontext-on-all-platforms.patch @@ -0,0 +1,54 @@ +From dc66835022cf68085400f2eed30614c5afdc28a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sat, 16 Jul 2022 09:21:11 +0200 +Subject: [PATCH] druntime: link against libucontext on all platforms + +On musl-based Linux distributions, swapcontext etc. are not provided by +musl but instead by libucontext. Hence, we _always_ need to link against +an external library for these functions. +--- + libphobos/configure | 8 -------- + libphobos/m4/druntime/libraries.m4 | 8 -------- + 2 files changed, 16 deletions(-) + +diff --git a/libphobos/configure b/libphobos/configure +index 4f5be7d4ff4..0a48032edb4 100755 +--- a/libphobos/configure ++++ b/libphobos/configure +@@ -15420,14 +15420,6 @@ fi + # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to + # "yes" for targets that have 'version = AsmExternal'. + druntime_fiber_asm_external=no +- case "$target_cpu" in +- aarch64* | \ +- arm* | \ +- i[34567]86|x86_64 | \ +- powerpc) +- druntime_fiber_asm_external=yes +- ;; +- esac + if test "$druntime_fiber_asm_external" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 + $as_echo_n "checking for library containing swapcontext... " >&6; } +diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 +index 8dd9c7da107..b61bf528a14 100644 +--- a/libphobos/m4/druntime/libraries.m4 ++++ b/libphobos/m4/druntime/libraries.m4 +@@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], + # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to + # "yes" for targets that have 'version = AsmExternal'. + druntime_fiber_asm_external=no +- case "$target_cpu" in +- aarch64* | \ +- arm* | \ +- i[[34567]]86|x86_64 | \ +- powerpc) +- druntime_fiber_asm_external=yes +- ;; +- esac + if test "$druntime_fiber_asm_external" = no; then + AC_SEARCH_LIBS([swapcontext], [c ucontext], [], + AC_MSG_ERROR([swapcontext required but not found])) +-- +2.50.1 + diff --git a/cross/gcc-x86/0033-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-x86/0033-libphobos-do-not-use-LFS64-symbols.patch deleted file mode 100644 index 138bd64b7..000000000 --- a/cross/gcc-x86/0033-libphobos-do-not-use-LFS64-symbols.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 29 May 2023 15:33:11 +0000 -Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols - -musl does not have these since 1.2.4, we can't use the compat interfaces. ---- - libphobos/libdruntime/core/sys/posix/config.d | 2 +- - libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- - 2 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d -index ae6752f220e..6b80d1ff0e6 100644 ---- a/libphobos/libdruntime/core/sys/posix/config.d -+++ b/libphobos/libdruntime/core/sys/posix/config.d -@@ -88,7 +88,7 @@ else version (CRuntime_Musl) - enum __REDIRECT = false; - - // Those three are irrelevant for Musl as it always uses 64 bits off_t -- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64; -+ enum __USE_FILE_OFFSET64 = false; - enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT; - enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT; - -diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d -index 0d3d517d69a..323aa0af72d 100644 ---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d -+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d -@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) - } - else version (CRuntime_Musl) - { -- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); -- static if (__USE_FILE_OFFSET64) -- alias mmap = mmap64; -- else -- void* mmap(void*, size_t, int, int, int, off_t); -+ void* mmap(void*, size_t, int, int, int, off_t); - int munmap(void*, size_t); - } - else version (CRuntime_UClibc) --- -2.41.0 - diff --git a/cross/gcc-x86/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-x86/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch new file mode 100644 index 000000000..38354fa65 --- /dev/null +++ b/cross/gcc-x86/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch @@ -0,0 +1,25 @@ +From ab88348da140c68e5e1142041dbe1c7b7d9c9a07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Tue, 19 Jul 2022 14:54:07 +0200 +Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc + +--- + gcc/ada/libgnat/s-parame.ads | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 98284a4d13e..0d14f116a10 100644 +--- a/gcc/ada/libgnat/s-parame.ads ++++ b/gcc/ada/libgnat/s-parame.ads +@@ -101,7 +101,7 @@ package System.Parameters is + -- Characteristics of time_t type -- + ------------------------------------ + +- time_t_bits : constant := Long_Integer'Size; ++ time_t_bits : constant := Long_Long_Integer'Size; + -- Number of bits in type time_t + + ---------------------------------------------- +-- +2.50.1 + diff --git a/cross/gcc-x86/0034-libgo-fix-lfs64-use.patch b/cross/gcc-x86/0034-libgo-fix-lfs64-use.patch deleted file mode 100644 index cf47858d6..000000000 --- a/cross/gcc-x86/0034-libgo-fix-lfs64-use.patch +++ /dev/null @@ -1,195 +0,0 @@ -From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 10 Jul 2023 23:23:29 +0000 -Subject: [PATCH 34/35] libgo: fix lfs64 use - ---- - .../go/internal/syscall/unix/at_largefile.go | 2 +- - libgo/go/os/dir_largefile.go | 2 +- - libgo/go/syscall/libcall_glibc.go | 2 +- - libgo/go/syscall/libcall_linux.go | 4 +-- - libgo/go/syscall/libcall_posix_largefile.go | 26 +++++++++---------- - libgo/runtime/go-varargs.c | 2 +- - libgo/sysinfo.c | 9 +++---- - 7 files changed, 22 insertions(+), 25 deletions(-) - -diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go -index 82e0dcfd074..16151ecad1b 100644 ---- a/libgo/go/internal/syscall/unix/at_largefile.go -+++ b/libgo/go/internal/syscall/unix/at_largefile.go -@@ -10,5 +10,5 @@ import ( - "syscall" - ) - --//extern fstatat64 -+//extern fstatat - func fstatat(int32, *byte, *syscall.Stat_t, int32) int32 -diff --git a/libgo/go/os/dir_largefile.go b/libgo/go/os/dir_largefile.go -index 1fc5ee0771f..0c6dffe1a75 100644 ---- a/libgo/go/os/dir_largefile.go -+++ b/libgo/go/os/dir_largefile.go -@@ -11,5 +11,5 @@ package os - - import "syscall" - --//extern readdir64 -+//extern readdir - func libc_readdir(*syscall.DIR) *syscall.Dirent -diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go -index 5c1ec483c75..5a1245ed44b 100644 ---- a/libgo/go/syscall/libcall_glibc.go -+++ b/libgo/go/syscall/libcall_glibc.go -@@ -114,7 +114,7 @@ func Pipe2(p []int, flags int) (err error) { - } - - //sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error) --//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t -+//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t - - func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - if race.Enabled { -diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go -index 03ca7261b59..ad21fd0b3ac 100644 ---- a/libgo/go/syscall/libcall_linux.go -+++ b/libgo/go/syscall/libcall_linux.go -@@ -158,7 +158,7 @@ func Reboot(cmd int) (err error) { - //adjtimex(buf *Timex) _C_int - - //sys Fstatfs(fd int, buf *Statfs_t) (err error) --//fstatfs64(fd _C_int, buf *Statfs_t) _C_int -+//fstatfs(fd _C_int, buf *Statfs_t) _C_int - - func Gettid() (tid int) { - r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0) -@@ -245,7 +245,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i - } - - //sys Statfs(path string, buf *Statfs_t) (err error) --//statfs64(path *byte, buf *Statfs_t) _C_int -+//statfs(path *byte, buf *Statfs_t) _C_int - - //sysnb Sysinfo(info *Sysinfo_t) (err error) - //sysinfo(info *Sysinfo_t) _C_int -diff --git a/libgo/go/syscall/libcall_posix_largefile.go b/libgo/go/syscall/libcall_posix_largefile.go -index f90055bb29a..334212f0af1 100644 ---- a/libgo/go/syscall/libcall_posix_largefile.go -+++ b/libgo/go/syscall/libcall_posix_largefile.go -@@ -10,40 +10,40 @@ - package syscall - - //sys Creat(path string, mode uint32) (fd int, err error) --//creat64(path *byte, mode Mode_t) _C_int -+//creat(path *byte, mode Mode_t) _C_int - - //sys Fstat(fd int, stat *Stat_t) (err error) --//fstat64(fd _C_int, stat *Stat_t) _C_int -+//fstat(fd _C_int, stat *Stat_t) _C_int - - //sys Ftruncate(fd int, length int64) (err error) --//ftruncate64(fd _C_int, length Offset_t) _C_int -+//ftruncate(fd _C_int, length Offset_t) _C_int - - //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) --//getrlimit64(resource _C_int, rlim *Rlimit) _C_int -+//getrlimit(resource _C_int, rlim *Rlimit) _C_int - - //sys Lstat(path string, stat *Stat_t) (err error) --//lstat64(path *byte, stat *Stat_t) _C_int -+//lstat(path *byte, stat *Stat_t) _C_int - - //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) --//mmap64(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte -+//mmap(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte - - //sys Open(path string, mode int, perm uint32) (fd int, err error) --//__go_open64(path *byte, mode _C_int, perm Mode_t) _C_int -+//__go_open(path *byte, mode _C_int, perm Mode_t) _C_int - - //sys Pread(fd int, p []byte, offset int64) (n int, err error) --//pread64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t -+//pread(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t - - //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) --//pwrite64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t -+//pwrite(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t - - //sys Seek(fd int, offset int64, whence int) (off int64, err error) --//lseek64(fd _C_int, offset Offset_t, whence _C_int) Offset_t -+//lseek(fd _C_int, offset Offset_t, whence _C_int) Offset_t - - //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) --//setrlimit64(resource int, rlim *Rlimit) _C_int -+//setrlimit(resource int, rlim *Rlimit) _C_int - - //sys Stat(path string, stat *Stat_t) (err error) --//stat64(path *byte, stat *Stat_t) _C_int -+//stat(path *byte, stat *Stat_t) _C_int - - //sys Truncate(path string, length int64) (err error) --//truncate64(path *byte, length Offset_t) _C_int -+//truncate(path *byte, length Offset_t) _C_int -diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c -index f84860891e6..7efc9615985 100644 ---- a/libgo/runtime/go-varargs.c -+++ b/libgo/runtime/go-varargs.c -@@ -84,7 +84,7 @@ __go_ioctl_ptr (int d, int request, void *arg) - int - __go_open64 (char *path, int mode, mode_t perm) - { -- return open64 (path, mode, perm); -+ return open (path, mode, perm); - } - - #endif -diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c -index 180f5c31d74..1d717d55c0e 100644 ---- a/libgo/sysinfo.c -+++ b/libgo/sysinfo.c -@@ -366,7 +366,7 @@ typedef loff_t libgo_loff_t_type; - #endif - - #if defined(HAVE_OFF64_T) --typedef off64_t libgo_off_t_type; -+typedef off_t libgo_off_t_type; - #else - typedef off_t libgo_off_t_type; - #endif -@@ -398,13 +398,11 @@ typedef off_t libgo_off_t_type; - - // From dirent.h - SREF(dirent); --SREF(dirent64); - OTREF(DIR); - EREF(DT_UNKNOWN); - - // From fcntl.h - SREF(flock); --SREF(flock64); - - // From ffi headers - SREF(_ffi_type); -@@ -485,11 +483,10 @@ EREF(SS_ONSTACK); - EREF(SEGV_MAPERR); - - // From stat.h --SREF(stat64); -+SREF(stat); - - // From statfs.h - SREF(statfs); --SREF(statfs64); - - // From sysinfo.h - SREF(sysinfo); -@@ -519,7 +516,7 @@ EREF(PTRACE_PEEKTEXT); - - // From sys/resource.h - SREF(rusage); --SREF(rlimit64); -+SREF(rlimit); - EREF(RLIMIT_NOFILE); - EREF(PRIO_USER); - EREF(RUSAGE_SELF); --- -2.41.0 - diff --git a/cross/gcc-x86/0035-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-x86/0035-libphobos-do-not-use-LFS64-symbols.patch new file mode 100644 index 000000000..692f764f6 --- /dev/null +++ b/cross/gcc-x86/0035-libphobos-do-not-use-LFS64-symbols.patch @@ -0,0 +1,30 @@ +From f865fb0a27252bd3a01fc4596f101d389929311c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 29 May 2023 15:33:11 +0000 +Subject: [PATCH] libphobos: do not use LFS64 symbols + +musl does not have these since 1.2.4, we can't use the compat interfaces. +--- + libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d +index b1eb9fa8107..3aee0d96319 100644 +--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d ++++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d +@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) + } + else version (CRuntime_Musl) + { +- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); +- static if (__USE_FILE_OFFSET64) +- alias mmap = mmap64; +- else +- void* mmap(void*, size_t, int, int, int, off_t); ++ void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); + } + else version (CRuntime_UClibc) +-- +2.50.1 + diff --git a/cross/gcc-x86/0035-loongarch-disable-multilib-support.patch b/cross/gcc-x86/0035-loongarch-disable-multilib-support.patch deleted file mode 100644 index acfc47c7f..000000000 --- a/cross/gcc-x86/0035-loongarch-disable-multilib-support.patch +++ /dev/null @@ -1,32 +0,0 @@ -From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001 -From: Jingyun Hua -Date: Mon, 7 Aug 2023 15:25:58 +0800 -Subject: [PATCH] loongarch disable multilib support - -Signed-off-by: Jingyun Hua ---- - gcc/config/loongarch/t-linux | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux -index 23e1fb979..c2753abb8 100644 ---- a/gcc/config/loongarch/t-linux -+++ b/gcc/config/loongarch/t-linux -@@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) - MULTIOSDIR_lp64s := ../lib64/sf$(call if_multiarch,:loongarch64-linux-gnusf) - - # Don't define MULTILIB_OSDIRNAMES if multilib is disabled. --ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),) -- -- MULTILIB_OSDIRNAMES = .=$(MULTIOSDIR_$(mlib_default)) -- MULTILIB_OSDIRNAMES += mabi.lp64d=$(MULTIOSDIR_lp64d) -- MULTILIB_OSDIRNAMES += mabi.lp64f=$(MULTIOSDIR_lp64f) -- MULTILIB_OSDIRNAMES += mabi.lp64s=$(MULTIOSDIR_lp64s) -- --endif -+ MULTILIB_OSDIRNAMES = mabi.lp64d=../lib -+ MULTILIB_OSDIRNAMES += mabi.lp64f=../lib -+ MULTILIB_OSDIRNAMES += mabi.lp64s=../lib --- -2.41.0 - diff --git a/cross/gcc-x86/0036-libgo-fix-lfs64-use.patch b/cross/gcc-x86/0036-libgo-fix-lfs64-use.patch new file mode 100644 index 000000000..355edd642 --- /dev/null +++ b/cross/gcc-x86/0036-libgo-fix-lfs64-use.patch @@ -0,0 +1,195 @@ +From cf6ba089ba26cd970962e874a3e35f020c3e921c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 10 Jul 2023 23:23:29 +0000 +Subject: [PATCH] libgo: fix lfs64 use + +--- + .../go/internal/syscall/unix/at_largefile.go | 2 +- + libgo/go/os/dir_largefile.go | 2 +- + libgo/go/syscall/libcall_glibc.go | 2 +- + libgo/go/syscall/libcall_linux.go | 4 +-- + libgo/go/syscall/libcall_posix_largefile.go | 26 +++++++++---------- + libgo/runtime/go-varargs.c | 2 +- + libgo/sysinfo.c | 9 +++---- + 7 files changed, 22 insertions(+), 25 deletions(-) + +diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go +index 82e0dcfd074..16151ecad1b 100644 +--- a/libgo/go/internal/syscall/unix/at_largefile.go ++++ b/libgo/go/internal/syscall/unix/at_largefile.go +@@ -10,5 +10,5 @@ import ( + "syscall" + ) + +-//extern fstatat64 ++//extern fstatat + func fstatat(int32, *byte, *syscall.Stat_t, int32) int32 +diff --git a/libgo/go/os/dir_largefile.go b/libgo/go/os/dir_largefile.go +index 1fc5ee0771f..0c6dffe1a75 100644 +--- a/libgo/go/os/dir_largefile.go ++++ b/libgo/go/os/dir_largefile.go +@@ -11,5 +11,5 @@ package os + + import "syscall" + +-//extern readdir64 ++//extern readdir + func libc_readdir(*syscall.DIR) *syscall.Dirent +diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go +index 5c1ec483c75..5a1245ed44b 100644 +--- a/libgo/go/syscall/libcall_glibc.go ++++ b/libgo/go/syscall/libcall_glibc.go +@@ -114,7 +114,7 @@ func Pipe2(p []int, flags int) (err error) { + } + + //sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error) +-//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t ++//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t + + func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if race.Enabled { +diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go +index 03ca7261b59..ad21fd0b3ac 100644 +--- a/libgo/go/syscall/libcall_linux.go ++++ b/libgo/go/syscall/libcall_linux.go +@@ -158,7 +158,7 @@ func Reboot(cmd int) (err error) { + //adjtimex(buf *Timex) _C_int + + //sys Fstatfs(fd int, buf *Statfs_t) (err error) +-//fstatfs64(fd _C_int, buf *Statfs_t) _C_int ++//fstatfs(fd _C_int, buf *Statfs_t) _C_int + + func Gettid() (tid int) { + r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0) +@@ -245,7 +245,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i + } + + //sys Statfs(path string, buf *Statfs_t) (err error) +-//statfs64(path *byte, buf *Statfs_t) _C_int ++//statfs(path *byte, buf *Statfs_t) _C_int + + //sysnb Sysinfo(info *Sysinfo_t) (err error) + //sysinfo(info *Sysinfo_t) _C_int +diff --git a/libgo/go/syscall/libcall_posix_largefile.go b/libgo/go/syscall/libcall_posix_largefile.go +index f90055bb29a..334212f0af1 100644 +--- a/libgo/go/syscall/libcall_posix_largefile.go ++++ b/libgo/go/syscall/libcall_posix_largefile.go +@@ -10,40 +10,40 @@ + package syscall + + //sys Creat(path string, mode uint32) (fd int, err error) +-//creat64(path *byte, mode Mode_t) _C_int ++//creat(path *byte, mode Mode_t) _C_int + + //sys Fstat(fd int, stat *Stat_t) (err error) +-//fstat64(fd _C_int, stat *Stat_t) _C_int ++//fstat(fd _C_int, stat *Stat_t) _C_int + + //sys Ftruncate(fd int, length int64) (err error) +-//ftruncate64(fd _C_int, length Offset_t) _C_int ++//ftruncate(fd _C_int, length Offset_t) _C_int + + //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) +-//getrlimit64(resource _C_int, rlim *Rlimit) _C_int ++//getrlimit(resource _C_int, rlim *Rlimit) _C_int + + //sys Lstat(path string, stat *Stat_t) (err error) +-//lstat64(path *byte, stat *Stat_t) _C_int ++//lstat(path *byte, stat *Stat_t) _C_int + + //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) +-//mmap64(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte ++//mmap(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte + + //sys Open(path string, mode int, perm uint32) (fd int, err error) +-//__go_open64(path *byte, mode _C_int, perm Mode_t) _C_int ++//__go_open(path *byte, mode _C_int, perm Mode_t) _C_int + + //sys Pread(fd int, p []byte, offset int64) (n int, err error) +-//pread64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t ++//pread(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t + + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +-//pwrite64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t ++//pwrite(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t + + //sys Seek(fd int, offset int64, whence int) (off int64, err error) +-//lseek64(fd _C_int, offset Offset_t, whence _C_int) Offset_t ++//lseek(fd _C_int, offset Offset_t, whence _C_int) Offset_t + + //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) +-//setrlimit64(resource int, rlim *Rlimit) _C_int ++//setrlimit(resource int, rlim *Rlimit) _C_int + + //sys Stat(path string, stat *Stat_t) (err error) +-//stat64(path *byte, stat *Stat_t) _C_int ++//stat(path *byte, stat *Stat_t) _C_int + + //sys Truncate(path string, length int64) (err error) +-//truncate64(path *byte, length Offset_t) _C_int ++//truncate(path *byte, length Offset_t) _C_int +diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c +index f84860891e6..7efc9615985 100644 +--- a/libgo/runtime/go-varargs.c ++++ b/libgo/runtime/go-varargs.c +@@ -84,7 +84,7 @@ __go_ioctl_ptr (int d, int request, void *arg) + int + __go_open64 (char *path, int mode, mode_t perm) + { +- return open64 (path, mode, perm); ++ return open (path, mode, perm); + } + + #endif +diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c +index 180f5c31d74..1d717d55c0e 100644 +--- a/libgo/sysinfo.c ++++ b/libgo/sysinfo.c +@@ -366,7 +366,7 @@ typedef loff_t libgo_loff_t_type; + #endif + + #if defined(HAVE_OFF64_T) +-typedef off64_t libgo_off_t_type; ++typedef off_t libgo_off_t_type; + #else + typedef off_t libgo_off_t_type; + #endif +@@ -398,13 +398,11 @@ typedef off_t libgo_off_t_type; + + // From dirent.h + SREF(dirent); +-SREF(dirent64); + OTREF(DIR); + EREF(DT_UNKNOWN); + + // From fcntl.h + SREF(flock); +-SREF(flock64); + + // From ffi headers + SREF(_ffi_type); +@@ -485,11 +483,10 @@ EREF(SS_ONSTACK); + EREF(SEGV_MAPERR); + + // From stat.h +-SREF(stat64); ++SREF(stat); + + // From statfs.h + SREF(statfs); +-SREF(statfs64); + + // From sysinfo.h + SREF(sysinfo); +@@ -519,7 +516,7 @@ EREF(PTRACE_PEEKTEXT); + + // From sys/resource.h + SREF(rusage); +-SREF(rlimit64); ++SREF(rlimit); + EREF(RLIMIT_NOFILE); + EREF(PRIO_USER); + EREF(RUSAGE_SELF); +-- +2.50.1 + diff --git a/cross/gcc-x86/0036-libphobos-add-riscv64-and-loongarch64-support.patch b/cross/gcc-x86/0036-libphobos-add-riscv64-and-loongarch64-support.patch deleted file mode 100644 index ba8377b1d..000000000 --- a/cross/gcc-x86/0036-libphobos-add-riscv64-and-loongarch64-support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Celeste -Date: Mon, 2 Sep 2024 02:54:17 +0000 -Subject: [PATCH] libphobos: add riscv64 and loongarch64 support - -Add musl support for these 2 architectures based on fenv.h and signal.h from: - -https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5 - -https://git.musl-libc.org/cgit/musl/tree/arch/loongarch64/bits?h=v1.2.5 ---- - libphobos/libdruntime/core/stdc/fenv.d | 13 +++++++++++++ - libphobos/libdruntime/core/sys/posix/signal.d | 10 ++++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d -index a7364c0a..5b327e4a 100644 ---- a/libphobos/libdruntime/core/stdc/fenv.d -+++ b/libphobos/libdruntime/core/stdc/fenv.d -@@ -436,20 +436,33 @@ else version (CRuntime_Musl) - ushort __cs_selector; - ushort __opcode; - uint __data_offset; - ushort __data_selector; - ushort __unused5; - version (X86_64) - uint __mxcsr; - } - alias ushort fexcept_t; - } -+ else version (RISCV64) -+ { -+ alias uint fenv_t; -+ alias uint fexcept_t; -+ } -+ else version (LoongArch64) -+ { -+ struct fenv_t -+ { -+ uint __cw; -+ } -+ alias uint fexcept_t; -+ } - else - { - static assert(false, "Architecture not supported."); - } - } - else version (CRuntime_Newlib) - { - version (AArch64) - { - alias fenv_t = ulong; -diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d -index a8b7f751..78d8b3cd 100644 ---- a/libphobos/libdruntime/core/sys/posix/signal.d -+++ b/libphobos/libdruntime/core/sys/posix/signal.d -@@ -2751,20 +2751,30 @@ else version (CRuntime_Musl) - else version (PPC_Any) - { - enum MINSIGSTKSZ = 4096; - enum SIGSTKSZ = 10240; - } - else version (X86_Any) - { - enum MINSIGSTKSZ = 2048; - enum SIGSTKSZ = 8192; - } -+ else version (RISCV64) -+ { -+ enum MINSIGSTKSZ = 2048; -+ enum SIGSTKSZ = 8192; -+ } -+ else version (LoongArch64) -+ { -+ enum MINSIGSTKSZ = 4096; -+ enum SIGSTKSZ = 16384; -+ } - else - static assert(0, "unimplemented"); - - //ucontext_t (defined in core.sys.posix.ucontext) - //mcontext_t (defined in core.sys.posix.ucontext) - - version (MIPS_Any) - { - struct stack_t - { diff --git a/cross/gcc-x86/0037-loongarch-disable-multilib-support.patch b/cross/gcc-x86/0037-loongarch-disable-multilib-support.patch new file mode 100644 index 000000000..da7e8b34d --- /dev/null +++ b/cross/gcc-x86/0037-loongarch-disable-multilib-support.patch @@ -0,0 +1,32 @@ +From a809e7b909e16fcf3379571417d33574e9c1dbff Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Mon, 7 Aug 2023 15:25:58 +0800 +Subject: [PATCH] loongarch disable multilib support + +Signed-off-by: Jingyun Hua +--- + gcc/config/loongarch/t-linux | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux +index 45862048abf..73155acd832 100644 +--- a/gcc/config/loongarch/t-linux ++++ b/gcc/config/loongarch/t-linux +@@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) + MULTIOSDIR_lp64s := ../lib64/sf$(call if_multiarch,:loongarch64-linux-gnusf) + + # Don't define MULTILIB_OSDIRNAMES if multilib is disabled. +-ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),) +- +- MULTILIB_OSDIRNAMES = .=$(MULTIOSDIR_$(mlib_default)) +- MULTILIB_OSDIRNAMES += mabi.lp64d=$(MULTIOSDIR_lp64d) +- MULTILIB_OSDIRNAMES += mabi.lp64f=$(MULTIOSDIR_lp64f) +- MULTILIB_OSDIRNAMES += mabi.lp64s=$(MULTIOSDIR_lp64s) +- +-endif ++ MULTILIB_OSDIRNAMES = mabi.lp64d=../lib ++ MULTILIB_OSDIRNAMES += mabi.lp64f=../lib ++ MULTILIB_OSDIRNAMES += mabi.lp64s=../lib +-- +2.50.1 + diff --git a/cross/gcc-x86/0037-static-pie.patch b/cross/gcc-x86/0037-static-pie.patch deleted file mode 100644 index a31c20e7e..000000000 --- a/cross/gcc-x86/0037-static-pie.patch +++ /dev/null @@ -1,101 +0,0 @@ -Patch-Source: https://github.com/richfelker/musl-cross-make/blob/6f3701d08137496d5aac479e3a3977b5ae993c1f/patches/gcc-14.2.0/0004-static-pie.diff - -gcc doesn't enable static-pie for all arches. As of this writing arm -32-bit is missing. musl supports static-pie on all arches so this -should be allowed on all arches. - -Without this patch binaries with (only) -static-pie are broken on some -arches. - -diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver - - no-pie - Driver RejectNegative Negative(shared) --Don't create a dynamically linked position independent executable. -+Don't create a position independent executable. - - pie - Driver RejectNegative Negative(no-pie) --Create a dynamically linked position independent executable. -+Create a position independent executable. - - static-pie - Driver RejectNegative Negative(pie) -diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 ---- a/gcc/config/gnu-user.h -+++ b/gcc/config/gnu-user.h -@@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define GNU_USER_TARGET_STARTFILE_SPEC \ - "%{shared:; \ - pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \ -- static:crt1.o%s; \ -- static-pie:rcrt1.o%s; \ -+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ - " PIE_SPEC ":Scrt1.o%s; \ - :crt1.o%s} " \ - GNU_USER_TARGET_CRTI " \ -- %{static:crtbeginT.o%s; \ -- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ -+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \ -+ static:crtbeginT.o%s; \ - :crtbegin.o%s} \ - %{fvtable-verify=none:%s; \ - fvtable-verify=preinit:vtv_start_preinit.o%s; \ -@@ -73,11 +72,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - GNU userspace "finalizer" file, `crtn.o'. */ - - #define GNU_USER_TARGET_ENDFILE_SPEC \ -- "%{!static:%{fvtable-verify=none:%s; \ -+ "%{static|static-pie:; \ -+ fvtable-verify=none:%s; \ - fvtable-verify=preinit:vtv_end_preinit.o%s; \ -- fvtable-verify=std:vtv_end.o%s}} \ -- %{static:crtend.o%s; \ -- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ -+ fvtable-verify=std:vtv_end.o%s} \ -+ %{shared|" PIE_SPEC ":crtendS.o%s; \ - :crtend.o%s} " \ - GNU_USER_TARGET_CRTN " " \ - CRTOFFLOADEND -@@ -106,7 +105,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC - - #if defined(HAVE_LD_EH_FRAME_HDR) --#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " -+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " - #endif - - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ -diff --git a/gcc/gcc.cc b/gcc/gcc.cc -index 3c81c5798d8..cd96eac5d12 100644 ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ - #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC - #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" - #else --#define PIE_SPEC "pie" -+#define PIE_SPEC "pie|static-pie" - #define FPIE1_SPEC "fpie" - #define NO_FPIE1_SPEC FPIE1_SPEC ":;" - #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ - #ifndef LINK_PIE_SPEC - #ifdef HAVE_LD_PIE - #ifndef LD_PIE_SPEC --#define LD_PIE_SPEC "-pie" -+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic %{static-pie:-static}}" - #endif - #else - #define LD_PIE_SPEC "" - #endif --#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " -+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " - #endif - - #ifndef LINK_BUILDID_SPEC diff --git a/cross/gcc-x86/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-x86/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch deleted file mode 100644 index b55477e53..000000000 --- a/cross/gcc-x86/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 49926c2c657dd867f7329df6e250913fd1425475 Mon Sep 17 00:00:00 2001 -From: Andrew Pinski -Date: Fri, 28 Mar 2025 17:25:56 -0700 -Subject: [PATCH] except: Don't use the cached value of the gcc_except_table - section for comdat functions [PR119507] - -This has been broken since GCC started to put the comdat functions' gcc_except_table into their -own section; r0-118218-g3e6011cfebedfb. What would happen is after a non-comdat function is processed, -the cached value would always be used even for comdat function. Instead we should create a new -section for comdat functions. - -OK? Bootstrapped and tested on x86_64-linux-gnu. - - PR middle-end/119507 - -gcc/ChangeLog: - - * except.cc (switch_to_exception_section): Don't use the cached section if - the current function is in comdat. - -gcc/testsuite/ChangeLog: - - * g++.dg/eh/pr119507.C: New test. - -Signed-off-by: Andrew Pinski ---- - gcc/except.cc | 9 ++++++++- - gcc/testsuite/g++.dg/eh/pr119507.C | 17 +++++++++++++++++ - 2 files changed, 25 insertions(+), 1 deletion(-) - create mode 100644 gcc/testsuite/g++.dg/eh/pr119507.C - -diff --git a/gcc/except.cc b/gcc/except.cc -index 205811c6567..0fe1e093489 100644 ---- a/gcc/except.cc -+++ b/gcc/except.cc -@@ -2949,7 +2949,14 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname)) - { - section *s; - -- if (exception_section) -+ if (exception_section -+ /* Don't use the cached section for comdat if it will be different. */ -+#ifdef HAVE_LD_EH_GC_SECTIONS -+ && !(targetm_common.have_named_sections -+ && DECL_COMDAT_GROUP (current_function_decl) -+ && HAVE_COMDAT_GROUP) -+#endif -+ ) - s = exception_section; - else - { -diff --git a/gcc/testsuite/g++.dg/eh/pr119507.C b/gcc/testsuite/g++.dg/eh/pr119507.C -new file mode 100644 -index 00000000000..50afa75a43f ---- /dev/null -+++ b/gcc/testsuite/g++.dg/eh/pr119507.C -@@ -0,0 +1,17 @@ -+// { dg-do compile { target comdat_group } } -+// Force off function sections -+// Force on exceptions -+// { dg-options "-fno-function-sections -fexceptions" } -+// PR middle-end/119507 -+ -+ -+inline int comdat() { try { throw 1; } catch (int) { return 1; } return 0; } -+int another_func_with_exception() { try { throw 1; } catch (int) { return 1; } return 0; } -+inline int comdat1() { try { throw 1; } catch (int) { return 1; } return 0; } -+int foo() { return comdat() + comdat1(); } -+ -+// Make sure the gcc puts the exception table for both comdat and comdat1 in their own section -+// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z6comdatv" 1 } } -+// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z7comdat1v" 1 } } -+// There should be 3 exception tables, -+// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } --- -2.49.0 - diff --git a/cross/gcc-x86/0038-static-PIE-ensure-static-reaches-the-linker.patch b/cross/gcc-x86/0038-static-PIE-ensure-static-reaches-the-linker.patch new file mode 100644 index 000000000..bd870a370 --- /dev/null +++ b/cross/gcc-x86/0038-static-PIE-ensure-static-reaches-the-linker.patch @@ -0,0 +1,113 @@ +From 72606254a2456763cb252b4d729a9505e77e449d Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Fri, 25 Jul 2025 02:41:46 -0700 +Subject: [PATCH] static PIE: ensure -static reaches the linker + +on some targets, the logic for the compiler option -static seems not +to be processed when -pie is present. rather than playing +whack-a-mole, just ensure LD_PIE_SPEC specs always pass -static to ld +if either -static or -static-pie is present on the compiler driver +command line. + +this may produce redundant -static arguments but it doesn't matter. +--- + gcc/common.opt | 4 ++-- + gcc/config/gnu-user.h | 17 ++++++++--------- + gcc/gcc.cc | 6 +++--- + 3 files changed, 13 insertions(+), 14 deletions(-) + +diff --git a/gcc/common.opt b/gcc/common.opt +index e65a575d9f8..7ad38711f6e 100644 +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -3968,11 +3968,11 @@ Driver + + no-pie + Driver RejectNegative Negative(shared) +-Don't create a dynamically linked position independent executable. ++Don't create a position independent executable. + + pie + Driver RejectNegative Negative(no-pie) +-Create a dynamically linked position independent executable. ++Create a position independent executable. + + static-pie + Driver RejectNegative Negative(pie) +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 0426efdb8c3..866c8bd77f2 100644 +--- a/gcc/config/gnu-user.h ++++ b/gcc/config/gnu-user.h +@@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define GNU_USER_TARGET_STARTFILE_SPEC \ + "%{shared:; \ + pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \ +- static:crt1.o%s; \ +- static-pie:rcrt1.o%s; \ ++ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ + " PIE_SPEC ":Scrt1.o%s; \ + :crt1.o%s} " \ + GNU_USER_TARGET_CRTI " \ +- %{static:crtbeginT.o%s; \ +- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ ++ %{shared|" PIE_SPEC ":crtbeginS.o%s; \ ++ static:crtbeginT.o%s; \ + :crtbegin.o%s} \ + %{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_start_preinit.o%s; \ +@@ -73,11 +72,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + GNU userspace "finalizer" file, `crtn.o'. */ + + #define GNU_USER_TARGET_ENDFILE_SPEC \ +- "%{!static:%{fvtable-verify=none:%s; \ ++ "%{static|static-pie:; \ ++ fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ +- fvtable-verify=std:vtv_end.o%s}} \ +- %{static:crtend.o%s; \ +- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ ++ fvtable-verify=std:vtv_end.o%s} \ ++ %{shared|" PIE_SPEC ":crtendS.o%s; \ + :crtend.o%s} " \ + GNU_USER_TARGET_CRTN " " \ + CRTOFFLOADEND +@@ -106,7 +105,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " ++#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " + #endif + + #if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e9f78f0f4c1..767ff65f348 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1056,7 +1056,7 @@ proper position among the other output files. */ + #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC + #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" + #else +-#define PIE_SPEC "pie" ++#define PIE_SPEC "pie|static-pie" + #define FPIE1_SPEC "fpie" + #define NO_FPIE1_SPEC FPIE1_SPEC ":;" + #define FPIE2_SPEC "fPIE" +@@ -1080,12 +1080,12 @@ proper position among the other output files. */ + #ifndef LINK_PIE_SPEC + #ifdef HAVE_LD_PIE + #ifndef LD_PIE_SPEC +-#define LD_PIE_SPEC "-pie" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic -static}" + #endif + #else + #define LD_PIE_SPEC "" + #endif +-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " ++#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " + #endif + + #ifndef LINK_BUILDID_SPEC +-- +2.50.1 + diff --git a/cross/gcc-x86/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-x86/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch new file mode 100644 index 000000000..c713030bb --- /dev/null +++ b/cross/gcc-x86/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch @@ -0,0 +1,77 @@ +From d984c5c9ed973bb7072b48399e5d9bb1f35c3123 Mon Sep 17 00:00:00 2001 +From: Andrew Pinski +Date: Fri, 28 Mar 2025 17:25:56 -0700 +Subject: [PATCH] except: Don't use the cached value of the gcc_except_table + section for comdat functions [PR119507] + +This has been broken since GCC started to put the comdat functions' gcc_except_table into their +own section; r0-118218-g3e6011cfebedfb. What would happen is after a non-comdat function is processed, +the cached value would always be used even for comdat function. Instead we should create a new +section for comdat functions. + +OK? Bootstrapped and tested on x86_64-linux-gnu. + + PR middle-end/119507 + +gcc/ChangeLog: + + * except.cc (switch_to_exception_section): Don't use the cached section if + the current function is in comdat. + +gcc/testsuite/ChangeLog: + + * g++.dg/eh/pr119507.C: New test. + +Signed-off-by: Andrew Pinski +--- + gcc/except.cc | 9 ++++++++- + gcc/testsuite/g++.dg/eh/pr119507.C | 17 +++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/g++.dg/eh/pr119507.C + +diff --git a/gcc/except.cc b/gcc/except.cc +index 205811c6567..0fe1e093489 100644 +--- a/gcc/except.cc ++++ b/gcc/except.cc +@@ -2949,7 +2949,14 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname)) + { + section *s; + +- if (exception_section) ++ if (exception_section ++ /* Don't use the cached section for comdat if it will be different. */ ++#ifdef HAVE_LD_EH_GC_SECTIONS ++ && !(targetm_common.have_named_sections ++ && DECL_COMDAT_GROUP (current_function_decl) ++ && HAVE_COMDAT_GROUP) ++#endif ++ ) + s = exception_section; + else + { +diff --git a/gcc/testsuite/g++.dg/eh/pr119507.C b/gcc/testsuite/g++.dg/eh/pr119507.C +new file mode 100644 +index 00000000000..50afa75a43f +--- /dev/null ++++ b/gcc/testsuite/g++.dg/eh/pr119507.C +@@ -0,0 +1,17 @@ ++// { dg-do compile { target comdat_group } } ++// Force off function sections ++// Force on exceptions ++// { dg-options "-fno-function-sections -fexceptions" } ++// PR middle-end/119507 ++ ++ ++inline int comdat() { try { throw 1; } catch (int) { return 1; } return 0; } ++int another_func_with_exception() { try { throw 1; } catch (int) { return 1; } return 0; } ++inline int comdat1() { try { throw 1; } catch (int) { return 1; } return 0; } ++int foo() { return comdat() + comdat1(); } ++ ++// Make sure the gcc puts the exception table for both comdat and comdat1 in their own section ++// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z6comdatv" 1 } } ++// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z7comdat1v" 1 } } ++// There should be 3 exception tables, ++// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } +-- +2.50.1 + diff --git a/cross/gcc-x86/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch b/cross/gcc-x86/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch new file mode 100644 index 000000000..a25266014 --- /dev/null +++ b/cross/gcc-x86/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch @@ -0,0 +1,164 @@ +From 57eb290b3c8fc36da99213f5050b46cd93575234 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Sat, 26 Jul 2025 02:59:45 -0700 +Subject: [PATCH] ada: libgnat: use stub symbolic module name functions + +The "linux" implementation depends on glibc internals and accordingly +does not work on musl. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/Makefile.rtl | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index cb41e6887cd..152ba70db4d 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1642,7 +1642,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb +Date: Sat, 26 Jul 2025 03:02:38 -0700 +Subject: [PATCH] ada: libgnat: recognize linux-musleabi and linux-muslgnueabi + platforms for ARM + +--- + gcc/ada/Makefile.rtl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 152ba70db4d..89574cdfba7 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2500,7 +2500,7 @@ endif + + # ARM linux, GNU eabi + ifeq ($(SELECTED_PAIRS),PAIRS_NONE) +-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),) ++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),) + + SELECTED_PAIRS=arm-linux-gnueabi + +-- +2.50.1 + diff --git a/cross/gcc-x86/APKBUILD b/cross/gcc-x86/APKBUILD index 0c79f74f2..e2d801d31 100644 --- a/cross/gcc-x86/APKBUILD +++ b/cross/gcc-x86/APKBUILD @@ -24,7 +24,7 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-x86 -pkgver=14.3.0 +pkgver=15.1.1_git20250719 # i.e. 13.2.1, must match gcc/BASE-VER _pkgbase="${pkgver%%_git*}" # date component from snapshots @@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-x86 -pkgrel=6 +pkgrel=2 pkgdesc="Stage2 cross-compiler for x86" url="https://gcc.gnu.org" arch="x86_64" @@ -183,7 +183,7 @@ if $_libgomp; then fi case "$CTARGET_ARCH" in -riscv64|loongarch64) +riscv64) LANG_ADA=false;; esac @@ -241,7 +241,7 @@ fi # PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches, # so that they can be properly tracked and easily rebased if needed. #source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz -source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz +source="https://gcc.gnu.org/pub/gcc/snapshots/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-specs-turn-on-Wl-z-now-by-default.patch @@ -249,37 +249,40 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch 0006-Enable-Wformat-and-Wformat-security-by-default.patch 0007-Enable-Wtrampolines-by-default.patch - 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch - 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch - 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch - 0011-libiberty-copy-PIC-objects-during-build-process.patch - 0012-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-libphobos-do-not-use-LFS64-symbols.patch - 0034-libgo-fix-lfs64-use.patch - 0035-loongarch-disable-multilib-support.patch - 0036-libphobos-add-riscv64-and-loongarch64-support.patch - 0037-static-pie.patch - 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch + 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch + 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0012-libiberty-copy-PIC-objects-during-build-process.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-ada-fix-shared-linking.patch + 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0017-add-fortify-headers-paths.patch + 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0020-aarch64-disable-multilib-support.patch + 0021-s390x-disable-multilib-support.patch + 0022-ppc64-le-disable-multilib-support.patch + 0023-x86_64-disable-multilib-support.patch + 0024-riscv-disable-multilib-support.patch + 0025-always-build-libgcc_eh.a.patch + 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch + 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch + 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch + 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch + 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch + 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch + 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch + 0033-druntime-link-against-libucontext-on-all-platforms.patch + 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch + 0035-libphobos-do-not-use-LFS64-symbols.patch + 0036-libgo-fix-lfs64-use.patch + 0037-loongarch-disable-multilib-support.patch + 0038-static-PIE-ensure-static-reaches-the-linker.patch + 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch + 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " # secfixes: @@ -287,8 +290,8 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz # - CVE-2023-4039 # we build out-of-tree -#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap -builddir="$srcdir"/gcc-$_pkgbase +builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap +#builddir="$srcdir"/gcc-$_pkgbase _gcclibdir="usr/lib/gcc/$CTARGET/$_pkgbase" _gcclibexec="usr/libexec/gcc/$CTARGET/$_pkgbase" @@ -752,43 +755,46 @@ gdb() { } sha512sums=" -cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93 gcc-14.3.0.tar.xz -1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch -6dd1eecbc050e30e5a0493969a0e80507d971f4ca87c06466f725fa50c9106e18aef86453fc8a80cd277438b6e79695a99cdaf2eaeb2f1add7e28f7cffd0cd2f 0002-gcc-poison-system-directories.patch -b6903b60b01187bfebc961e74d01ff5d8dc2852747663dff2b4a4f66df4b5aa412347fe92926cce1821fdd0c59d088404acbbced4b464aba9664d599a9e1bbce 0003-specs-turn-on-Wl-z-now-by-default.patch -d41a519ea5014e9ab49f017d3793e2a0a82429c2b7ded2776f2df7a2d0ac02aa294e7dbe74e027fe7c844c87525d483e0eda3846cf16340eb02e934389cfd838 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e34d7bb51c4c413b1a10bafcdfd5729fb5980b0288277ef44ed4779700d443d2fd22129b3b22d401def140851263e803160d2f3ed8825b0bf4f3fb8606db77bd 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -83665b6adb0b8080245b253abe3344ee5106ac2bc248aad9bef713b22b644a268d75c75fbab7554e0543836903a89bc4f0bec4b6d6d4e3d5ba355dddbc5ba190 0006-Enable-Wformat-and-Wformat-security-by-default.patch -ca5757a32f02bb24bc5b42bb03dca49fb9f9e6f34776343f1c5580efd2bcacf8c5b59f4b61652fa3ea1506eb14bcd390f5fda7b4cbfd32f7d1a750d14add4739 0007-Enable-Wtrampolines-by-default.patch -e476da4c2f29a941b7f4f1dfc9a37ba82b439badc47fc3fb72630ec5620f64849bdb66d339e0182674a0ee898a75564ffaf702986b770bfd793e7fbdcaa9f21b 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch -b40b6cbc3725ae88c506bc39a8ba10cfcdcc208fa26d667393bbb80e24346da2ccfac3ff914bb9fc4c374f022fa7f913e6873b9a66a96b79a1ac84959c9d5348 0012-libgcc_s.patch -6cc2c00b15d259289fa9831b60b58f8afdf09858410bd08ab3d839a45c6f3fb9e8e214dab851d105c61df7965f1c10255c84b5b6301630a390b27b8929a25e1e 0013-nopie.patch -0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch -7640e71cd957066e2e07ffcec1f8540cd6b1bdaf976c980693bf6f5d3afaf51ca7e41c62f92cb13c86c2dea9eb9cd799b2e3ea77d74926e82bf1e12bb7a4d64e 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch -8a8c9dc96f300f660f1a643c800352383f32db258dfcfa88a44159a38bb81a7298089a5dcb23906002c85cafc806caf6f3db0e1cb26fcac6192ae1e41d9ada3a 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -6c1cbfcf9e6f54b2173af39bbbfd97e7c18ae32a690fb4c6b1e35fa183992ea0f8046d479be57b6ac7d798bf2a6dade4f9ea3e3a839dc6fb8d47203de9c89e25 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch -a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch -f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch -44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch -0ef65a344975b641343767e289578ba5b0fd381c7177ebe4558cb67d8b41e33e3b825478fa46852f1f40ec9119ff908cf75ee36307266aea13f39460e080b0b6 0023-riscv-disable-multilib-support.patch -55438233a217dc1ee58990413b8782b9bd560a1532c1e6c860f377072ed1bdf75d5dc2458ed33194040ec5427c30df3fa68948dcd26de90e3803d3f7b784becd 0024-always-build-libgcc_eh.a.patch -8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch -02e8358b8855fb49bbb2b3ef293cff67441c5fdf1f2fee4dcec86ef1fd4f701e899ea9c7e072d888b0f1e674d7874d3085138f3deb9845d1f2e35d4a1fe3f5ab 0026-ada-musl-support-fixes.patch -8eff7679140f9e39f1a0ac2e4a6cc7e131efa3d5a669696dd28300eb5d75ef3be62f10c1b91d8f8c8ba2cba1ff9cf121228b6fcd3adafa28389ac63698e7d5a7 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch -720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch -2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch -458c9b121e00cec4d0dbe1d18c5e5332342eb0a3429129e5a9d9ace3247c31d85571ad9f47046c4ed3bc62e5d8a4297f48744a30424a19acbdd9aa484e3ee715 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch -099103f4b0b4612ff4bd2e8721cf1593415b636bff74d4feba304bb610ced6f4951cb3ab89088111e58029a2f9bf4a5dcc91e2b2afe4dd9813d2fa6b0999a5a2 0031-druntime-link-against-libucontext-on-all-platforms.patch -21ff4d55eec48ad4a9db0cd359e760cff548f7f6b1a67759a2e87fc7e16a262d82d2f980d309a3ce5e14097665beeb5516a5f2d98869a5d28345e685c6fe689d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch -c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch -c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch -65df1d489e8d07a811f39e27fd29e3b2b4164fbc2c5fdc16a5142886d94a96e3fb28ccf4f20dd297ba6540ef8ea1ac3eb65a4279494639bf2f0f8376a3896cc3 0035-loongarch-disable-multilib-support.patch -06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch -8249ce989c1a76bcb5bbb1123ef88d88f220b709fe6ac804f18c905a7b31c4e68ef6f5cc2236f446feed89fa773a3aed996a6aba7618e73a000d73cb0b0753f6 0037-static-pie.patch -90b6148d47f39caf1b70416abf2a09f4ce048491f784f56bd659dbf99e2c9f6a44b244827f23977494ab4e42640c49c1dc79f43a4d69c2b31c4b1e25d54d8142 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +a5e0082e492502385565479201bca3e9f5138a55d83540bff8b84a94d958c4d2afce474328656ee7d55fad910c04523c0068efe92382e68a327a65f6e641b88a gcc-15-20250719.tar.xz +fd5cebc5deb1d588583424acbc1b5a6d8d6f5b1bfa9f4bdbc082cfd406723f423d87011ee30e04ed18128a7ed8021cbfc9262becff5419125dc1afb6f407defa 0001-posix_memalign.patch +6634004cb9feea9ee0d063d6b6984d7db3b10c692b6139bb99169a4f2d74f0e10b5ca0ab31ce346ffef34b8eb9c3f536aa4d94bce1b27f8e0b8a9fc5cc4b7057 0002-gcc-poison-system-directories.patch +37e089791dbcbad73af866b662cda611dc0970d93e28251c7a9aa898db3b96446654e8b778d7866eb8550ba7f4a57cf22e8514d562bfed0c66613e65550d9c85 0003-specs-turn-on-Wl-z-now-by-default.patch +d4d5bfeb20a9fac968f37497d86d7eff4a9ac863e015dadbffae24c08236f5efde69b615d95191e2546672ce2d4b30d3627528c64a83fc64b715e8fa6fd4c372 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +b77cd1ee887fc52afee2fafd2d338f70a62c115017aa4fcb0ab9cf82b8a003794f75b7913cc153c767c351d2be8e1e7c113f893edee818217f20cad3cb6a2e66 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +af634de360e8b7aef285702815affb16da667719b786848ccdb9e4cca2a27826793f64c903a32a5d8ba1953965a5cc8999c58e2b6ce9ef36f74807e495cc9e42 0006-Enable-Wformat-and-Wformat-security-by-default.patch +21ad1cd4b7ef652ddaf6b9fb8071a87ec2fc694e8c420a79baf456347b8e1db5930a914c92a375943dda63d096c4823a2b8028d02a5b49c9bcdab5c170558004 0007-Enable-Wtrampolines-by-default.patch +dcd07ecf0daad8743a378abbcb921d4b17e528651a596454956563a3417fe9ea3b88dce7b15b9270f55ae2ea2a72efe8a7215236d0a21e2942c7c5ba0e8e2c39 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch +488bd530e209e3213f83d695fb2ac529c408e3dba9024457594cfb0d266acb079447bca184fbf136bacd1f1ec5ca3607dc4998b66630af9781ea7ee41c16236b 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch +7229a3fe655e8460148e0cd4c39d7362e713d1a6215530547f346371a5e3647245123637e8b075c58c5e7e35c823d96a0b3cdbedb6c07b5095507b4499bc053a 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +f7c1870bda4d418380f471b520b7cf20fde743f57415323c1a8898a815f8c7023adc3882e1d0453c5b6fcb65a27a9534fdeb297bf451453a95d90c0395e42c3b 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch +140c8165726404da0fc0ea01add2a7fa307377817968177334c520bdaabc23e8ec5d76f80337b89ff03edfd52dead7119433a03d2165e24780dc944633a9c2a3 0012-libiberty-copy-PIC-objects-during-build-process.patch +af848ef58b63a7592ad0f549be65fbe8dcd3c1e5ea9f30cfa65be02519ca9826d7612131c3b0042615b7537683d74eeb6849aba61810b0d8ed1c79f968188260 0013-libgcc_s.patch +c97b473c08b46090b48764af55b244ec70a13d26f2d881c57761abbc4a1c481da9766f33e59daee7188bc06c4631e53becbaf8801d0b35ca0b5fe84cb6a840f7 0014-nopie.patch +9c37cc38bb7238058751d3ff60712acd4134aa4c28d946c453b8b230bd6ba34c45c47a4b4d7e74aa7e3ed8dfc74cbb1d5a328bda706dd3037320e02a15421b86 0015-ada-fix-shared-linking.patch +b4afb30431ecdfd86acfd66ba857c275628b55e91cc9b21c18ca0e795b2fadfe895da801978a8e818ff9c93144075e72cf0521f3bce5c6c1d44e47e1b77b8ba4 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +6260341ed13926ce449cf351ada85d8e28fc7da63a4ae73b69c24fb2e8d0e3003ffacb1bb0f957185b8d5d7e013f777f7f696c9a1c94b2204a9b3e8274ec2f43 0017-add-fortify-headers-paths.patch +8fe954daf7e9b1d221f0536f54186bc1715e23cf3c74dfd0956c0fa22ce3b5b5e30b5e17ea584db1cc193ac7fdc72daff68c9163dbc46a837e01d25a7a4a90e0 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +fc5ce12cd70382b15317931ff0f57ae1ed10e8c09dbf2fee627bc55a268f55ebbf9ae32b89b4ef6f51e9a9b7ca32eed201245d481cde88f6eb572d40134f5f4c 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +e0d4fd0e0bf4ecfb517b60b55d73f326deda0faa75bfd07d1fcae116f91088a96caaa2dd20e2e38a93cc8ffed0aef422c0c861879c8de406364faef0cbcd50ff 0020-aarch64-disable-multilib-support.patch +7af318ea6fe14dce98b8db1f8f46a2dc9f75c2f27e63a52c62c7b47d6d62cb64748d5c2690eba772d931ff96ac089e3f03bf46b49122ffb5a03a1c186f01ae11 0021-s390x-disable-multilib-support.patch +b96dbbd0e1aa98ebc2e7eaa2a44912681e4c8bc9a129fafa53a943d67b62451b6d4fad53f92429cd4346a753527359c8c09d58836cf0968a56f5fe933496a412 0022-ppc64-le-disable-multilib-support.patch +60106cb08f27c89509ba46dc2ff0edecc1f4c7973874c85047dfdd67eabe50e3a852d7540002a09bcb6185c786a5daeba7915958c441fc92d7f16a0cce5bcdea 0023-x86_64-disable-multilib-support.patch +d55d65242af9341eef7f1e3d03fec2e2de75632a23ed83df4fe6304619f62127b42eba9d9286f7f3647e3b9bd95aaeb79023263e71ff9d58c47f3051b73d8bc2 0024-riscv-disable-multilib-support.patch +b6dda179cafbd9e7f3ef7e137b303a76491a0157d68f1504dee6611cecdca16d27ca32cbd2298da2f6301e7167b8730d70a775ee5ba88ae3773adef8421efa98 0025-always-build-libgcc_eh.a.patch +95245b6548ddca5065bac06131294028767a32740c80f707a4d1cf8653a0398305ec68e7c44a3f2912741b792d41048f03729657b0a1c1a2a7bff097c6b2fdc7 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch +ff6b8b9e1ab9b45d1853e74befb5c904cf7cd83dadb5a4b6f8c94a75e6249d1cdaa72aef73d6b1045beabc2d9012ea869d886015ec3aae561eb4ba8b9d00c2d7 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch +0582f00e8801df06e51fca45a8dc3ee62e9b6ce9245af98937f435c90c709edc7eb9071569c0e59c9a143d964fe5731b9e11b011174443b97043abddc9db1cce 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch +8683314212c0a6f49ed45ea8c74908f59d863822fa8c99e94c7e39ba3a642ca6a3167543e1ae4b58d8acd1ff97824d6e60cc432b19e6580cad2027e3a5c37603 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +60bb67f6cf4b92243dec861fba702aa5847925bf413c2c83705a0ee4ebe4c523cc295cce29666c69c9b2dec70d63def83cd9074e613b4f46e014248f53c87db4 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch +b49f72cce409f74407761fe64b028e97d58e4f236af7d9099189a8553f2ece3f30559760fab768f3d1fc4c7f89ae3ee6d687018251f3df52c9a43817c9c7c93e 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +0bd3aa81590d5f47205e193d2998bb5986cbb82adb75e3d39dcf820625bb358d380d1695ebbb18437fdd935ce350b0f5b7364a5fa7c8e07ebe8f972c8cd46cd1 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch +e8d5c4159f41fcb09e76758768d127ff366c93095137b694a405e9dbba88f2036ba64b69ac6c5c75e488be3281a1227cccbadcea2bef6f60ba0be7fc3d7db754 0033-druntime-link-against-libucontext-on-all-platforms.patch +6f530cdb1935296925ec29be7a30e4d69cebc155695db6ea30ee95ce65de7e8917e2a6148d3668974715120e7f13f734e5c36bfd35f707f4725a7556cbc1caa5 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +1dabb0c8d581ec86d8758dfa3d2f1713d915f6d927639f56b3590ed9b0885dfdf452e30ca87edac49721d2dc43d4fbdb4d178f8448e8ba5cc595457f216bf210 0035-libphobos-do-not-use-LFS64-symbols.patch +b915a0eaf7cc3e48f41f31ebbd9142760891b9ede304ff3f1dc7166f85a9e3f82017a17bb7e65824d3da07445b2c8bcd156a992eed92633362c08329b04b6cb4 0036-libgo-fix-lfs64-use.patch +0164467e66719187b6041c8d2d717a9bcd5b8c801dab6391b0e503c41e26518cc78389c97bdd2b2bc64f660f95410439aaa8a20799ec01eab17e7ba415ac1dd9 0037-loongarch-disable-multilib-support.patch +2cae2cb470b2cf469973c0ff3a7a020960cf4325502ff6c84c6b1b3514c8cacfae8452b5c79b55e657b0877fc9d81cc68db6f650156ca6d1376c1bd1a2290d8b 0038-static-PIE-ensure-static-reaches-the-linker.patch +7d73041566678fc86885877d8315481bf358858cbe54227356d5ab48623e435426ac7ff6e54d21b9fee4cc73e3f4bc7ef646d3e4ab1970e524c890cd1f735905 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +4556ead97907ec76aaa7dde450e4b6068f87268c49168eeb2af0c3df1dfa312b0a4a947b65b11fd413dae9af0beb3ef002d077c0d7f43b0bc466d3cd4348e657 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch +389eacbeba976a461af3d087d732d1c4f2a38bc5db91b935149e60ad4b210286ba76688b8a947d00f324566b6789152bf3b93a188fa2fb7ee8042786df483fed 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " diff --git a/cross/gcc-x86_64/0001-posix_memalign.patch b/cross/gcc-x86_64/0001-posix_memalign.patch index 04240c29c..bbc2db9ca 100644 --- a/cross/gcc-x86_64/0001-posix_memalign.patch +++ b/cross/gcc-x86_64/0001-posix_memalign.patch @@ -1,14 +1,14 @@ -From 47b4bd4deb2c356bb07d2a96f22127aefafec3a4 Mon Sep 17 00:00:00 2001 +From 94cf7d2b3514ed3a4401861a519ead450e022afc Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/35] posix_memalign +Subject: [PATCH] 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 3527283693b..c4071b64b53 100644 +index d1d79a32fc9..069c3bb8324 100644 --- a/gcc/config/i386/pmm_malloc.h +++ b/gcc/config/i386/pmm_malloc.h @@ -27,12 +27,13 @@ @@ -38,5 +38,5 @@ index 3527283693b..c4071b64b53 100644 else return NULL; -- -2.41.0 +2.50.1 diff --git a/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch b/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch index 9a1671267..de66b72d0 100644 --- a/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch +++ b/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch @@ -1,7 +1,7 @@ -From 4fa620d8c3e6730211bfb071eb4c817320491bd0 Mon Sep 17 00:00:00 2001 +From 0d5e04099a3d2609105719f7396a4ff941b873b6 Mon Sep 17 00:00:00 2001 From: Khem Raj -Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/35] gcc: poison-system-directories +Date: Thu, 23 Jan 2025 17:12:51 -0800 +Subject: [PATCH] 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 @@ -11,23 +11,25 @@ aborted. Instead, we add the two missing items to the current scan. If the user wants this to be a failure, they can add "-Werror=poison-system-directories". +Upstream-Status: Inappropriate [OE configuration] Signed-off-by: Mark Hatle +Signed-off-by: sunil dora Signed-off-by: Khem Raj - -Upstream-Status: Pending --- gcc/common.opt | 4 ++++ - gcc/config.in | 6 ++++++ - gcc/configure | 16 ++++++++++++++++ - gcc/configure.ac | 10 ++++++++++ + gcc/config.in | 10 ++++++++++ + gcc/configure | 19 +++++++++++++++++++ + gcc/configure.ac | 16 ++++++++++++++++ gcc/doc/invoke.texi | 9 +++++++++ - gcc/gcc.cc | 2 ++ - gcc/incpath.cc | 21 +++++++++++++++++++++ - 7 files changed, 68 insertions(+) + gcc/gcc.cc | 12 ++++++++++-- + gcc/incpath.cc | 25 +++++++++++++++++++++++++ + 7 files changed, 93 insertions(+), 2 deletions(-) +diff --git a/gcc/common.opt b/gcc/common.opt +index e3fa0dacec4..bea1adc0940 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -715,6 +715,10 @@ Wreturn-local-addr +@@ -729,6 +729,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. @@ -38,9 +40,11 @@ Upstream-Status: Pending Wshadow 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 a79c51adb2b..8a531ed591c 100644 --- a/gcc/config.in +++ b/gcc/config.in -@@ -249,6 +249,12 @@ +@@ -249,6 +249,16 @@ #endif @@ -48,14 +52,20 @@ Upstream-Status: Pending +#ifndef USED_FOR_TARGET +#undef ENABLE_POISON_SYSTEM_DIRECTORIES +#endif ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef POISON_BY_DEFAULT ++#endif + + /* Define if you want all operations on RTL (the basic data structure of the 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 16965953f05..0f4a5d52c30 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -1050,6 +1050,7 @@ enable_maintainer_mode +@@ -1051,6 +1051,7 @@ enable_maintainer_mode enable_link_mutex enable_link_serialization enable_version_specific_runtime_libs @@ -63,7 +73,7 @@ Upstream-Status: Pending enable_plugin enable_host_shared enable_host_pie -@@ -1823,6 +1824,8 @@ Optional Features: +@@ -1828,6 +1829,8 @@ Optional Features: --enable-version-specific-runtime-libs specify that runtime libraries should be installed in a compiler-specific directory @@ -72,7 +82,7 @@ Upstream-Status: Pending --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE -@@ -34082,6 +34085,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -83,47 +93,60 @@ Upstream-Status: Pending + enable_poison_system_directories=no +fi + -+if test "x${enable_poison_system_directories}" = "xyes"; then ++if test "x${enable_poison_system_directories}" != "xno"; then + +$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++if test "$enable_poison_system_directories" = "error"; then ++$as_echo "#define POISON_BY_DEFAULT 1" >>confdefs.h ++fi + +fi + # Substitute configuration variables +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 9f67e62950a..b0e3615e5aa 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -7555,6 +7555,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) +AC_ARG_ENABLE([poison-system-directories], + AS_HELP_STRING([--enable-poison-system-directories], -+ [warn for use of native system header directories]),, ++ [warn for use of native system header directories (no/yes/error)]),, + [enable_poison_system_directories=no]) -+if test "x${enable_poison_system_directories}" = "xyes"; then ++AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories]) ++if test "x${enable_poison_system_directories}" != "xno"; then ++ AC_MSG_NOTICE([poisoned directories enabled]) + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], + [1], + [Define to warn for use of native system header directories]) ++ if test $enable_poison_system_directories = "error"; then ++ AC_MSG_NOTICE([poisoned directories are fatal]) ++ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors]) ++ fi +fi + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 72009c33cd0..29aea724731 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. +@@ -405,6 +405,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 -@@ -8861,6 +8862,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. + -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor + -Wno-psabi + -Wredundant-decls -Wrestrict +@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default. + Suppress warnings from casts from a pointer to an integer type of a + different size. +@opindex Wno-poison-system-directories +@item -Wno-poison-system-directories @@ -133,12 +156,27 @@ Upstream-Status: Pending +directories contain the correct headers and libraries for the target +system rather than the host. + - @opindex Wfloat-equal - @opindex Wno-float-equal - @item -Wfloat-equal + @opindex Winvalid-pch + @opindex Wno-invalid-pch + @item -Winvalid-pch +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 4fd87f2c4a1..79d4920a047 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1163,6 +1163,8 @@ proper position among the other output files. */ +@@ -909,6 +909,12 @@ proper position among the other output files. */ + #define ASM_MAP "" + #endif + ++#ifdef POISON_BY_DEFAULT ++#define POISON_IS_ERROR " -Werror=poison-system-directories" ++#else ++#define POISON_IS_ERROR ++#endif ++ + /* Assembler options for compressed debug sections. */ + #if HAVE_LD_COMPRESS_DEBUG == 0 + /* Reject if the linker cannot write compressed debug sections. */ +@@ -1166,6 +1172,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}}} \ @@ -147,6 +185,26 @@ Upstream-Status: Pending %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +@@ -1268,7 +1276,7 @@ static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ + %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR; + + /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. + +@@ -1297,7 +1305,7 @@ static const char *cc1_options = + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +- %{pthread:-fprofile-update=prefer-atomic}}}"; ++ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR; + + static const char *asm_options = + "%{-target-help:%:print-asm-header()} " +diff --git a/gcc/incpath.cc b/gcc/incpath.cc +index c1bbfd3872a..2cdbebc4c50 100644 --- a/gcc/incpath.cc +++ b/gcc/incpath.cc @@ -26,6 +26,7 @@ @@ -157,9 +215,20 @@ Upstream-Status: Pending /* Microsoft Windows does not natively support inodes. VMS has non-numeric inodes. */ -@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) +@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + cur->name, xstrerror (errno)); + reason = REASON_NOENT; + } ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ pcur = &cur->next; ++ continue; ++#endif + } + else if (!S_ISDIR (st.st_mode)) + cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0, +@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + fprintf (stderr, _("End of #embed search list.\n")); } - fprintf (stderr, _("End of search list.\n")); } + +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES @@ -168,19 +237,22 @@ Upstream-Status: Pending + struct cpp_dir *p; + + for (p = heads[INC_QUOTE]; p; p = p->next) -+ { -+ if ((!strncmp (p->name, "/usr/include", 12)) -+ || (!strncmp (p->name, "/usr/local/include", 18)) -+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) -+ || (!strncmp (p->name, "/sw/include", 11)) -+ || (!strncmp (p->name, "/opt/include", 12))) -+ warning (OPT_Wpoison_system_directories, -+ "include location \"%s\" is unsafe for " -+ "cross-compilation", -+ p->name); -+ } ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } + } +#endif } /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0003-specs-turn-on-Wl-z-now-by-default.patch b/cross/gcc-x86_64/0003-specs-turn-on-Wl-z-now-by-default.patch index 33e8b56f1..be6a3dc60 100644 --- a/cross/gcc-x86_64/0003-specs-turn-on-Wl-z-now-by-default.patch +++ b/cross/gcc-x86_64/0003-specs-turn-on-Wl-z-now-by-default.patch @@ -1,7 +1,7 @@ -From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001 +From 90e8697dd88fd99ce2cf8739e95494853005377e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default +Subject: [PATCH] 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. @@ -13,9 +13,11 @@ now by default. gcc/gcc.cc | 1 + 2 files changed, 4 insertions(+) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 29aea724731..6fb3ab70cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -18935,6 +18935,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -19477,6 +19477,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}. @@ -25,9 +27,11 @@ now by default. @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 79d4920a047..74a356fdf5e 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -1161,6 +1161,7 @@ proper position among the other output files. */ +@@ -1170,6 +1170,7 @@ proper position among the other output files. */ "%{flto|flto=*:% Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, - ObjC, ObjC++, if the optimization level is > 0 +Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, + ObjC++, if the optimization level is > 0 --- gcc/c-family/c-cppbuiltin.cc | 4 ++++ gcc/doc/invoke.texi | 6 ++++++ 2 files changed, 10 insertions(+) +diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc +index 4589ee4a3a6..9edf095384c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc -@@ -1570,6 +1570,10 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -1581,6 +1581,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); @@ -22,9 +24,11 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, /* Misc. */ if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 6fb3ab70cc7..799ce073dbf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -12496,6 +12496,12 @@ also turns on the following optimization flags: +@@ -12840,6 +12840,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. @@ -37,3 +41,6 @@ Subject: [PATCH 04/35] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, @opindex O3 @item -O3 Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch b/cross/gcc-x86_64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch index 819ef5e76..deb4da3dc 100644 --- a/cross/gcc-x86_64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +++ b/cross/gcc-x86_64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -1,8 +1,8 @@ -From 67c0f5789630b27149f60ff831999ef7c1dba5d5 Mon Sep 17 00:00:00 2001 +From a59da582e83071de0566274d912ca6f05f4b75d0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the - linker, but always link the sanitizer libraries with --no-as-needed. +Subject: [PATCH] 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 + @@ -21,9 +21,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the gcc/gcc.cc | 28 ++++++++++++++++++++-------- 14 files changed, 36 insertions(+), 19 deletions(-) +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index 116bb4e69f3..daf99f8dce9 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h -@@ -35,6 +35,7 @@ +@@ -39,6 +39,7 @@ #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ @@ -31,6 +33,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 3fd3b831166..0b4c2dccebe 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 @@ -42,6 +46,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{O*:-O3} %{!O*:-O1} \ %{shared:-shared} \ %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index d4d389e2aa8..adccc0b11c2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -70,6 +70,7 @@ @@ -52,6 +58,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 4c4e31efa39..3c17ac6eade 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 @@ -78,6 +86,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the #endif #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index 7abfda53049..ceb8f855b7d 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 @@ -89,6 +99,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index abe714711bf..3ca128a79f5 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 @@ -99,6 +111,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index a2494c214c4..e1a5d530cdf 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -58,7 +58,7 @@ do { \ @@ -110,6 +124,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5a82508c113..6eee7cdc603 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 @@ -120,6 +136,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 9060c940a44..282c77b6a7b 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see @@ -130,6 +148,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ %{mno-relax:--no-relax} \ -X \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 0316d8cb65d..139e1b6796c 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -378,13 +378,13 @@ extern int dot_symbols; @@ -148,6 +168,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!static-pie: \ %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ +diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h +index afb5c6ad867..b64638fb25b 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC @@ -159,6 +181,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{rdynamic:-export-dynamic} \ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 2c3bca5dfcb..b90661247a4 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 @@ -170,6 +194,8 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{shared:-shared} \ %{!shared: \ %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 6d928846895..3cc05bb7240 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); @@ -181,9 +207,11 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!static: \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 74a356fdf5e..fc9c7d15b04 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc -@@ -771,8 +771,11 @@ proper position among the other output files. */ +@@ -774,8 +774,11 @@ proper position among the other output files. */ #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -197,7 +225,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -807,8 +810,11 @@ proper position among the other output files. */ +@@ -810,8 +813,11 @@ proper position among the other output files. */ #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -211,7 +239,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -825,8 +831,11 @@ proper position among the other output files. */ +@@ -828,8 +834,11 @@ proper position among the other output files. */ #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) @@ -225,7 +253,7 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -841,8 +850,11 @@ proper position among the other output files. */ +@@ -844,8 +853,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 @@ -239,3 +267,6 @@ Subject: [PATCH 05/35] On linux targets pass --as-needed by default to the STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0006-Enable-Wformat-and-Wformat-security-by-default.patch b/cross/gcc-x86_64/0006-Enable-Wformat-and-Wformat-security-by-default.patch index b4d580f85..b8851777b 100644 --- a/cross/gcc-x86_64/0006-Enable-Wformat-and-Wformat-security-by-default.patch +++ b/cross/gcc-x86_64/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -1,15 +1,17 @@ -From bb25e8489384504cd59e4a2538720863da1fb29c Mon Sep 17 00:00:00 2001 +From 35c02ea8267e193b92f30495c94ee1e8e5c2be8e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH] 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 75b6531860e..78830ce4b42 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -774,7 +774,7 @@ Warn about function calls with format strings that write past the end +@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end of the destination region. Wformat-security @@ -18,7 +20,7 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -799,7 +799,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -27,3 +29,6 @@ Subject: [PATCH 06/35] Enable -Wformat and -Wformat-security by default. Warn about printf/scanf/strftime/strfmon format string anomalies. Wframe-address +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch index 140685d7b..eda9ab096 100644 --- a/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch @@ -1,16 +1,18 @@ -From 4a728ad48a7b437cc6f2697e26603bf648149f86 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/35] Enable -Wtrampolines by default. +From 0b82663fd2f054e07e116c4dcc5019f7e969cd3e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:44:20 -0700 +Subject: [PATCH] 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 bea1adc0940..e65a575d9f8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -811,7 +811,7 @@ Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers. +@@ -829,7 +829,7 @@ Common Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wa + Warn if a comparison always evaluates to true or false. Wtrampolines -Common Var(warn_trampolines) Warning @@ -18,3 +20,6 @@ Subject: [PATCH 07/35] Enable -Wtrampolines by default. Warn whenever a trampoline is generated. Wtrivial-auto-var-init +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch b/cross/gcc-x86_64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch deleted file mode 100644 index e85284ff0..000000000 --- a/cross/gcc-x86_64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 32f24560d0602f7735d5e9efd92fe3151bd72cea Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/35] Disable ssp on -nostdlib, -nodefaultlibs and - -ffreestanding Change the buffer size. - ---- - gcc/gcc.cc | 8 +++++++- - gcc/params.opt | 2 +- - 2 files changed, 8 insertions(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1000,6 +1000,12 @@ proper position among the other output files. */ - #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" - #endif - -+#ifdef ENABLE_DEFAULT_SSP -+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " -+#else -+#define NO_SSP_SPEC "" -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1305,7 +1311,7 @@ static const char *cc1_options = - %{-version:--version}\ - %{-help=*:--help=%*}\ - %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ -- %{fsyntax-only:-o %j} %{-param*}\ -+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ - %{coverage:-fprofile-arcs -ftest-coverage}\ - %{fprofile-arcs|fcondition-coverage|fprofile-generate*|coverage:\ - %{!fprofile-update=single:\ ---- a/gcc/params.opt -+++ b/gcc/params.opt -@@ -1013,7 +1013,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim - The maximum number of SSA_NAME assignments to follow in determining a value. - - -param=ssp-buffer-size= --Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization -+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization - The lower bound for a buffer to be considered for stack smashing protection. - - -param=stack-clash-protection-guard-size= diff --git a/cross/gcc-x86_64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch b/cross/gcc-x86_64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch new file mode 100644 index 000000000..8997916ca --- /dev/null +++ b/cross/gcc-x86_64/0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch @@ -0,0 +1,39 @@ +From 3acf32fc94fd447874b2f1447a19a65f0905bff5 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:49:03 -0700 +Subject: [PATCH] gcc: disable SSP on -ffreestanding, -nostdlib and + -nodefaultlibs + +--- + gcc/gcc.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index fc9c7d15b04..7b0d3d2743b 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1009,6 +1009,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1314,7 +1320,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-x86_64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch deleted file mode 100644 index f4dd52f19..000000000 --- a/cross/gcc-x86_64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ /dev/null @@ -1,54 +0,0 @@ -From c7ec8da7280d7f97f5543eb9ddeca7600aafc43c Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/35] Ensure that msgfmt doesn't encounter problems during - gcc bootstrapping. - -Solves error messages like the following: - -msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) - -The libgcc_s.so used during build doesn't satisfy the needs of the -libstdc++.so that msgfmt is linked against. On the other hand, msgfmt -is used as a stand-alone application here, and what library it uses -behind the scenes is of no concern to the gcc build process. -Therefore, simply invoking it "as usual", i.e. without any special -library path, will make it work as expected here. - -2011-09-19 Martin von Gagern - -References: -https://bugs.gentoo.org/372377 -https://bugs.gentoo.org/295480 ---- - libstdc++-v3/po/Makefile.am | 1 + - libstdc++-v3/po/Makefile.in | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am -index 12d34910830..61b13762b71 100644 ---- a/libstdc++-v3/po/Makefile.am -+++ b/libstdc++-v3/po/Makefile.am -@@ -38,6 +38,7 @@ MSGFMT = msgfmt - EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) - - .po.mo: -+ env --unset=LD_LIBRARY_PATH \ - $(MSGFMT) -o $@ $< - - all-local: all-local-$(USE_NLS) -diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in -index 8e93445acd2..d6ff06e5ddb 100644 ---- a/libstdc++-v3/po/Makefile.in -+++ b/libstdc++-v3/po/Makefile.in -@@ -561,6 +561,7 @@ uninstall-am: - - - .po.mo: -+ env --unset=LD_LIBRARY_PATH \ - $(MSGFMT) -o $@ $< - - all-local: all-local-$(USE_NLS) --- -2.41.0 - diff --git a/cross/gcc-x86_64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch b/cross/gcc-x86_64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch new file mode 100644 index 000000000..8b25ba72d --- /dev/null +++ b/cross/gcc-x86_64/0009-gcc-params-set-default-ssp-buffer-size-to-4.patch @@ -0,0 +1,25 @@ +From bb98973bdb5fe8bd040e238afe92845203929b59 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 01:50:42 -0700 +Subject: [PATCH] gcc: params: set default ssp-buffer-size to 4 + +--- + gcc/params.opt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/params.opt b/gcc/params.opt +index 64e453d29b7..bba3fd574f2 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -1064,7 +1064,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-x86_64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch deleted file mode 100644 index f56d41a57..000000000 --- a/cross/gcc-x86_64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ /dev/null @@ -1,28 +0,0 @@ -From aaa029bcee68298695b7c4278c90b6bc320d098c Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/35] 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 1d5c779fcff..19e3cb1e31c 100644 ---- a/include/libiberty.h -+++ b/include/libiberty.h -@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *, - /* Like sprintf but provides a pointer to malloc'd storage, which must - be freed by the caller. */ - -+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ -+#ifndef asprintf - extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; - #endif -+#endif - - /* Like asprintf but allocates memory without fail. This works like - xmalloc. */ --- -2.41.0 - diff --git a/cross/gcc-x86_64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-x86_64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch new file mode 100644 index 000000000..c903a5cce --- /dev/null +++ b/cross/gcc-x86_64/0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -0,0 +1,54 @@ +From f89d8e95b809d02eceee416b463200c9abb2b33e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:50:33 +0000 +Subject: [PATCH] Ensure that msgfmt doesn't encounter problems during gcc + bootstrapping. + +Solves error messages like the following: + +msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) + +The libgcc_s.so used during build doesn't satisfy the needs of the +libstdc++.so that msgfmt is linked against. On the other hand, msgfmt +is used as a stand-alone application here, and what library it uses +behind the scenes is of no concern to the gcc build process. +Therefore, simply invoking it "as usual", i.e. without any special +library path, will make it work as expected here. + +2011-09-19 Martin von Gagern + +References: +https://bugs.gentoo.org/372377 +https://bugs.gentoo.org/295480 +--- + libstdc++-v3/po/Makefile.am | 1 + + libstdc++-v3/po/Makefile.in | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/libstdc++-v3/po/Makefile.am b/libstdc++-v3/po/Makefile.am +index 7f84a99533e..a4c6284f788 100644 +--- a/libstdc++-v3/po/Makefile.am ++++ b/libstdc++-v3/po/Makefile.am +@@ -38,6 +38,7 @@ MSGFMT = msgfmt + EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) +diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in +index 8e93445acd2..d6ff06e5ddb 100644 +--- a/libstdc++-v3/po/Makefile.in ++++ b/libstdc++-v3/po/Makefile.in +@@ -561,6 +561,7 @@ uninstall-am: + + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-x86_64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch new file mode 100644 index 000000000..48b22a5dc --- /dev/null +++ b/cross/gcc-x86_64/0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -0,0 +1,28 @@ +From b45303198567828a5240baf932a8c13255f35d20 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:52:07 +0000 +Subject: [PATCH] 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 d4e8791b14b..c074980ed80 100644 +--- a/include/libiberty.h ++++ b/include/libiberty.h +@@ -678,8 +678,11 @@ extern void *bsearch_r (const void *, const void *, + /* Like sprintf but provides a pointer to malloc'd storage, which must + be freed by the caller. */ + ++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ ++#ifndef asprintf + extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; + #endif ++#endif + + /* Like asprintf but allocates memory without fail. This works like + xmalloc. */ +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-x86_64/0011-libiberty-copy-PIC-objects-during-build-process.patch deleted file mode 100644 index b12d4f94b..000000000 --- a/cross/gcc-x86_64/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 65e01e749205c9af218b01233cebd0077538d0ee Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/35] 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 72608f3e4a7..58356884728 100644 ---- a/libiberty/Makefile.in -+++ b/libiberty/Makefile.in -@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) - $(AR) $(AR_FLAGS) $(TARGETLIB) \ - $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ - $(RANLIB) $(TARGETLIB); \ -+ cp $(TARGETLIB) ../ ; \ - cd ..; \ - else true; fi - --- -2.41.0 - diff --git a/cross/gcc-x86_64/0012-libgcc_s.patch b/cross/gcc-x86_64/0012-libgcc_s.patch deleted file mode 100644 index 8189f8491..000000000 --- a/cross/gcc-x86_64/0012-libgcc_s.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 453a815bf2844971a91eaef800af188d9e86b784 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 12/35] libgcc_s - ---- - gcc/config/i386/i386-expand.cc | 4 ++-- - libgcc/config/i386/cpuinfo.c | 6 +++--- - libgcc/config/i386/t-linux | 2 +- - 3 files changed, 6 insertions(+), 6 deletions(-) - ---- a/gcc/config/i386/i386-expand.cc -+++ b/gcc/config/i386/i386-expand.cc -@@ -13089,10 +13089,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, - { - case IX86_BUILTIN_CPU_INIT: - { -- /* Make it call __cpu_indicator_init in libgcc. */ -+ /* Make it call __cpu_indicator_init in libgcc.a. */ - tree call_expr, fndecl, type; - type = build_function_type_list (integer_type_node, NULL_TREE); -- fndecl = build_fn_decl ("__cpu_indicator_init", type); -+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type); - call_expr = build_call_expr (fndecl, 0); - return expand_expr (call_expr, target, mode, EXPAND_NORMAL); - } ---- a/libgcc/config/i386/cpuinfo.c -+++ b/libgcc/config/i386/cpuinfo.c -@@ -63,7 +63,7 @@ __cpu_indicator_init (void) - __cpu_features2); - } - --#if defined SHARED && defined USE_ELF_SYMVER --__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); --__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); -+#ifndef SHARED -+int __cpu_indicator_init_local (void) -+ __attribute__ ((weak, alias ("__cpu_indicator_init"))); - #endif ---- a/libgcc/config/i386/t-linux -+++ b/libgcc/config/i386/t-linux -@@ -3,5 +3,5 @@ - # t-slibgcc-elf-ver and t-linux - SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver - --HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER $(CET_FLAGS) -+HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) - CRTSTUFF_T_CFLAGS += $(CET_FLAGS) diff --git a/cross/gcc-x86_64/0012-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-x86_64/0012-libiberty-copy-PIC-objects-during-build-process.patch new file mode 100644 index 000000000..ff49be1c6 --- /dev/null +++ b/cross/gcc-x86_64/0012-libiberty-copy-PIC-objects-during-build-process.patch @@ -0,0 +1,24 @@ +From 68e2c9356221ba30b27840b9449f742505584cf1 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:53:00 +0000 +Subject: [PATCH] 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 ce54d88278d..10c212a1ad3 100644 +--- a/libiberty/Makefile.in ++++ b/libiberty/Makefile.in +@@ -266,6 +266,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0013-libgcc_s.patch b/cross/gcc-x86_64/0013-libgcc_s.patch new file mode 100644 index 000000000..99152585f --- /dev/null +++ b/cross/gcc-x86_64/0013-libgcc_s.patch @@ -0,0 +1,57 @@ +From ca482f8c9cac9617855f908dd30d3d6144e850a0 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Sat, 24 Oct 2015 20:09:53 +0000 +Subject: [PATCH] libgcc_s + +--- + gcc/config/i386/i386-expand.cc | 4 ++-- + libgcc/config/i386/cpuinfo.c | 6 +++--- + libgcc/config/i386/t-linux | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc +index cdfd94d3c73..a3a6c988833 100644 +--- a/gcc/config/i386/i386-expand.cc ++++ b/gcc/config/i386/i386-expand.cc +@@ -13643,10 +13643,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, + { + case IX86_BUILTIN_CPU_INIT: + { +- /* Make it call __cpu_indicator_init in libgcc. */ ++ /* Make it call __cpu_indicator_init in libgcc.a. */ + tree call_expr, fndecl, type; + type = build_function_type_list (integer_type_node, NULL_TREE); +- fndecl = build_fn_decl ("__cpu_indicator_init", type); ++ fndecl = build_fn_decl ("__cpu_indicator_init_local", type); + call_expr = build_call_expr (fndecl, 0); + return expand_expr (call_expr, target, mode, EXPAND_NORMAL); + } +diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c +index 2484dc839bf..e980030ef23 100644 +--- a/libgcc/config/i386/cpuinfo.c ++++ b/libgcc/config/i386/cpuinfo.c +@@ -63,7 +63,7 @@ __cpu_indicator_init (void) + __cpu_features2); + } + +-#if defined SHARED && defined USE_ELF_SYMVER +-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0"); +-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0"); ++#ifndef SHARED ++int __cpu_indicator_init_local (void) ++ __attribute__ ((weak, alias ("__cpu_indicator_init"))); + #endif +diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux +index 8506a635790..564296f788e 100644 +--- a/libgcc/config/i386/t-linux ++++ b/libgcc/config/i386/t-linux +@@ -3,5 +3,5 @@ + # t-slibgcc-elf-ver and t-linux + SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver + +-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.50.1 + diff --git a/cross/gcc-x86_64/0013-nopie.patch b/cross/gcc-x86_64/0013-nopie.patch deleted file mode 100644 index 4a9ea0770..000000000 --- a/cross/gcc-x86_64/0013-nopie.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 7d7d12137c666761a8dd61179c9651b85dae9b41 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 13/35] nopie - ---- - gcc/configure | 25 +++++++++++++++++++++++++ - gcc/configure.ac | 11 +++++++++++ - 2 files changed, 36 insertions(+) - ---- a/gcc/configure -+++ b/gcc/configure -@@ -34606,6 +34606,29 @@ rm -f core conftest.err conftest.$ac_objext \ - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 - $as_echo "$gcc_cv_no_pie" >&6; } -+# Check if -nopie works. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5 -+$as_echo_n "checking for -nopie option... " >&6; } -+if ${gcc_cv_nopie+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ saved_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS -nopie" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+int main(void) {return 0;} -+_ACEOF -+if ac_fn_cxx_try_link "$LINENO"; then : -+ gcc_cv_nopie=yes -+else -+ gcc_cv_nopie=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ LDFLAGS="$saved_LDFLAGS" -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5 -+$as_echo "$gcc_cv_nopie" >&6; } - - if test x$enable_host_shared = xyes; then - PICFLAG=-fPIC -@@ -34623,6 +34646,8 @@ if test x$enable_host_pie = xyes; then - LD_PICFLAG=-pie - elif test x$gcc_cv_no_pie = xyes; then - LD_PICFLAG=-no-pie -+elif test x$gcc_cv_nopie = xyes; then -+ LD_PICFLAG=-nopie - else - LD_PICFLAG= - fi ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -7821,6 +7821,15 @@ AC_CACHE_CHECK([for -no-pie option], - [gcc_cv_no_pie=yes], - [gcc_cv_no_pie=no]) - LDFLAGS="$saved_LDFLAGS"]) -+# Check if -nopie works. -+AC_CACHE_CHECK([for -nopie option], -+ [gcc_cv_nopie], -+ [saved_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS -nopie" -+ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])], -+ [gcc_cv_nopie=yes], -+ [gcc_cv_nopie=no]) -+ LDFLAGS="$saved_LDFLAGS"]) - - if test x$enable_host_shared = xyes; then - PICFLAG=-fPIC -@@ -7838,6 +7847,8 @@ if test x$enable_host_pie = xyes; then - LD_PICFLAG=-pie - elif test x$gcc_cv_no_pie = xyes; then - LD_PICFLAG=-no-pie -+elif test x$gcc_cv_nopie = xyes; then -+ LD_PICFLAG=-nopie - else - LD_PICFLAG= - fi diff --git a/cross/gcc-x86_64/0014-ada-fix-shared-linking.patch b/cross/gcc-x86_64/0014-ada-fix-shared-linking.patch deleted file mode 100644 index ff6e42921..000000000 --- a/cross/gcc-x86_64/0014-ada-fix-shared-linking.patch +++ /dev/null @@ -1,42 +0,0 @@ -From dd5bb97c31a9f57034c70a7a18ba6e2e133084c7 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 14/35] 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 f2126441208..22cfa9c641f 100644 ---- a/gcc/ada/link.c -+++ b/gcc/ada/link.c -@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; - || defined (__NetBSD__) || defined (__OpenBSD__) \ - || defined (__QNX__) - const char *__gnat_object_file_option = "-Wl,@"; --const char *__gnat_run_path_option = "-Wl,-rpath,"; --char __gnat_shared_libgnat_default = STATIC; --char __gnat_shared_libgcc_default = STATIC; -+const char *__gnat_run_path_option = ""; -+char __gnat_shared_libgnat_default = SHARED; -+char __gnat_shared_libgcc_default = SHARED; - int __gnat_link_max = 8192; - unsigned char __gnat_objlist_file_supported = 1; - const char *__gnat_object_library_extension = ".a"; -@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; - - #elif defined (__linux__) || defined (__GLIBC__) - const char *__gnat_object_file_option = "-Wl,@"; --const char *__gnat_run_path_option = "-Wl,-rpath,"; --char __gnat_shared_libgnat_default = STATIC; --char __gnat_shared_libgcc_default = STATIC; -+const char *__gnat_run_path_option = ""; -+char __gnat_shared_libgnat_default = SHARED; -+char __gnat_shared_libgcc_default = SHARED; - int __gnat_link_max = 8192; - unsigned char __gnat_objlist_file_supported = 1; - const char *__gnat_object_library_extension = ".a"; --- -2.41.0 - diff --git a/cross/gcc-x86_64/0014-nopie.patch b/cross/gcc-x86_64/0014-nopie.patch new file mode 100644 index 000000000..7117a9434 --- /dev/null +++ b/cross/gcc-x86_64/0014-nopie.patch @@ -0,0 +1,85 @@ +From 6dfb241ae9f879f4945941273dd73eb13f127b06 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Sat, 7 Nov 2015 02:08:05 +0000 +Subject: [PATCH] nopie + +--- + gcc/configure | 25 +++++++++++++++++++++++++ + gcc/configure.ac | 11 +++++++++++ + 2 files changed, 36 insertions(+) + +diff --git a/gcc/configure b/gcc/configure +index 0f4a5d52c30..343563c8948 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -34586,6 +34586,29 @@ rm -f core conftest.err conftest.$ac_objext \ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5 + $as_echo "$gcc_cv_no_pie" >&6; } ++# Check if -nopie works. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5 ++$as_echo_n "checking for -nopie option... " >&6; } ++if ${gcc_cv_nopie+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ saved_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -nopie" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++int main(void) {return 0;} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ gcc_cv_nopie=yes ++else ++ gcc_cv_nopie=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ LDFLAGS="$saved_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5 ++$as_echo "$gcc_cv_nopie" >&6; } + + if test x$enable_host_shared = xyes; then + PICFLAG=-fPIC +@@ -34603,6 +34626,8 @@ if test x$enable_host_pie = xyes; then + LD_PICFLAG=-pie + elif test x$gcc_cv_no_pie = xyes; then + LD_PICFLAG=-no-pie ++elif test x$gcc_cv_nopie = xyes; then ++ LD_PICFLAG=-nopie + else + LD_PICFLAG= + fi +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b0e3615e5aa..b3948469d17 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -7802,6 +7802,15 @@ AC_CACHE_CHECK([for -no-pie option], + [gcc_cv_no_pie=yes], + [gcc_cv_no_pie=no]) + LDFLAGS="$saved_LDFLAGS"]) ++# Check if -nopie works. ++AC_CACHE_CHECK([for -nopie option], ++ [gcc_cv_nopie], ++ [saved_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -nopie" ++ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])], ++ [gcc_cv_nopie=yes], ++ [gcc_cv_nopie=no]) ++ LDFLAGS="$saved_LDFLAGS"]) + + if test x$enable_host_shared = xyes; then + PICFLAG=-fPIC +@@ -7819,6 +7828,8 @@ if test x$enable_host_pie = xyes; then + LD_PICFLAG=-pie + elif test x$gcc_cv_no_pie = xyes; then + LD_PICFLAG=-no-pie ++elif test x$gcc_cv_nopie = xyes; then ++ LD_PICFLAG=-nopie + else + LD_PICFLAG= + fi +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0015-ada-fix-shared-linking.patch b/cross/gcc-x86_64/0015-ada-fix-shared-linking.patch new file mode 100644 index 000000000..a893502b7 --- /dev/null +++ b/cross/gcc-x86_64/0015-ada-fix-shared-linking.patch @@ -0,0 +1,42 @@ +From 8ac6aeca5d6192ee16b959bd8c1903a52d408a55 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:59:16 +0000 +Subject: [PATCH] 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 9e3385ca94f..2c0cca6e480 100644 +--- a/gcc/ada/link.c ++++ b/gcc/ada/link.c +@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; + || defined (__NetBSD__) || defined (__OpenBSD__) \ + || defined (__QNX__) + const char *__gnat_object_file_option = "-Wl,@"; +-const char *__gnat_run_path_option = "-Wl,-rpath,"; +-char __gnat_shared_libgnat_default = STATIC; +-char __gnat_shared_libgcc_default = STATIC; ++const char *__gnat_run_path_option = ""; ++char __gnat_shared_libgnat_default = SHARED; ++char __gnat_shared_libgcc_default = SHARED; + int __gnat_link_max = 8192; + unsigned char __gnat_objlist_file_supported = 1; + const char *__gnat_object_library_extension = ".a"; +@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir = "lib"; + + #elif defined (__linux__) || defined (__GLIBC__) + const char *__gnat_object_file_option = "-Wl,@"; +-const char *__gnat_run_path_option = "-Wl,-rpath,"; +-char __gnat_shared_libgnat_default = STATIC; +-char __gnat_shared_libgcc_default = STATIC; ++const char *__gnat_run_path_option = ""; ++char __gnat_shared_libgnat_default = SHARED; ++char __gnat_shared_libgcc_default = SHARED; + int __gnat_link_max = 8192; + unsigned char __gnat_objlist_file_supported = 1; + const char *__gnat_object_library_extension = ".a"; +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-x86_64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch deleted file mode 100644 index ddea4a05b..000000000 --- a/cross/gcc-x86_64/0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 6bb5b7d9161d05f31b001d8211a9c63caf63fd2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 15/35] build: fix CXXFLAGS_FOR_BUILD passing - ---- - Makefile.in | 1 + - 1 file changed, 1 insertion(+) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -179,6 +179,7 @@ BUILD_EXPORTS = \ - # built for the build system to override those in BASE_FLAGS_TO_PASS. - EXTRA_BUILD_FLAGS = \ - CFLAGS="$(CFLAGS_FOR_BUILD)" \ -+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ - LDFLAGS="$(LDFLAGS_FOR_BUILD)" - - # This is the list of directories to built for the host system. diff --git a/cross/gcc-x86_64/0016-add-fortify-headers-paths.patch b/cross/gcc-x86_64/0016-add-fortify-headers-paths.patch deleted file mode 100644 index b554e0251..000000000 --- a/cross/gcc-x86_64/0016-add-fortify-headers-paths.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f0d9e00cac06689f64b214de7aee80d7116ef084 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 16/35] 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 e3aca79cccc..b3537b8fbeb 100644 ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -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 \ -+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \ -+ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \ - { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ - { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, - #else --- -2.41.0 - diff --git a/cross/gcc-x86_64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-x86_64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch new file mode 100644 index 000000000..a6adebb1f --- /dev/null +++ b/cross/gcc-x86_64/0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -0,0 +1,24 @@ +From 7323d68ae46fc8e33c0746799d820a4e4c8c8b72 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:59:43 +0000 +Subject: [PATCH] build: fix CXXFLAGS_FOR_BUILD passing + +--- + Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.in b/Makefile.in +index b1ed67d3d4f..1e039c20550 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -179,6 +179,7 @@ BUILD_EXPORTS = \ + # built for the build system to override those in BASE_FLAGS_TO_PASS. + EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + + # This is the list of directories to built for the host system. +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-x86_64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch deleted file mode 100644 index 4796a055d..000000000 --- a/cross/gcc-x86_64/0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 857db04f4f1a06e866551b4172fe8f27363f4a92 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Timo=20Ter=C3=A4s?= -Date: Fri, 21 Aug 2020 07:03:00 +0000 -Subject: [PATCH 17/35] Alpine musl package provides libssp_nonshared.a. We - link to it unconditionally, as otherwise we get link failures if some objects - are -fstack-protector built and final link happens with -fno-stack-protector. - This seems to be the common case when bootstrapping gcc, the piepatches do - not seem to fully fix the crosstoolchain and bootstrap sequence wrt. - stack-protector flag usage. - ---- - gcc/gcc.cc | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1008,8 +1008,7 @@ proper position among the other output files. */ - - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP --#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -- "|fstack-protector-strong|fstack-protector-explicit:}" -+#define LINK_SSP_SPEC "-lssp_nonshared" - #else - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit" \ diff --git a/cross/gcc-x86_64/0017-add-fortify-headers-paths.patch b/cross/gcc-x86_64/0017-add-fortify-headers-paths.patch new file mode 100644 index 000000000..b4ecd2fd5 --- /dev/null +++ b/cross/gcc-x86_64/0017-add-fortify-headers-paths.patch @@ -0,0 +1,25 @@ +From eaf89c8c91806905c6e1ec9519cbfb56296204b0 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:01:06 +0000 +Subject: [PATCH] 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 d6280a4d4dd..ba69fb9fad7 100644 +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -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 \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, + #else +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-x86_64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch new file mode 100644 index 000000000..84731bb57 --- /dev/null +++ b/cross/gcc-x86_64/0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -0,0 +1,31 @@ +From bdedcd9db7b8291637c5147dd82e8a9e3f5f9c87 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= +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. + This seems to be the common case when bootstrapping gcc, the piepatches do + not seem to fully fix the crosstoolchain and bootstrap sequence wrt. + stack-protector flag usage. + +--- + gcc/gcc.cc | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 7b0d3d2743b..e46e976a2e8 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1017,8 +1017,7 @@ proper position among the other output files. */ + + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP +-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +- "|fstack-protector-strong|fstack-protector-explicit:}" ++#define LINK_SSP_SPEC "-lssp_nonshared" + #else + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-x86_64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch deleted file mode 100644 index b829e5b34..000000000 --- a/cross/gcc-x86_64/0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5a8347e23ab13912b6edec2c6c6e3a101b017c79 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 18/35] DP: Use --push-state/--pop-state for gold as well when - linking libtsan. - ---- - gcc/gcc.cc | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -772,10 +772,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 "}" \ -- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libasan:--push-state --no-as-needed}" \ - " -lasan " \ - " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libasan:--pop-state}" \ - STATIC_LIBASAN_LIBS - #else - #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -811,10 +811,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 "}" \ -- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libtsan:--push-state --no-as-needed}" \ - " -ltsan " \ - " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libtsan:--pop-state}" \ - STATIC_LIBTSAN_LIBS - #else - #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -832,10 +832,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 "}" \ -- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-liblsan:--push-state --no-as-needed}" \ - " -llsan " \ - " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-liblsan:--pop-state}" \ - STATIC_LIBLSAN_LIBS - #else - #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -851,10 +851,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 "}" \ -- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libubsan:--push-state --no-as-needed}" \ - " -lubsan " \ - " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libubsan:--pop-state}" \ - STATIC_LIBUBSAN_LIBS - #else - #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS diff --git a/cross/gcc-x86_64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-x86_64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch new file mode 100644 index 000000000..b703be7a7 --- /dev/null +++ b/cross/gcc-x86_64/0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -0,0 +1,69 @@ +From 586ce3614d4fc3fbeccf01659114a4643c1879c8 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:03:42 +0000 +Subject: [PATCH] DP: Use --push-state/--pop-state for gold as well when + linking libtsan. + +--- + gcc/gcc.cc | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e46e976a2e8..607c8ca1d42 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -775,10 +775,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 "}" \ +- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libasan:--push-state --no-as-needed}" \ + " -lasan " \ + " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libasan:--pop-state}" \ + STATIC_LIBASAN_LIBS + #else + #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS +@@ -814,10 +814,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 "}" \ +- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libtsan:--push-state --no-as-needed}" \ + " -ltsan " \ + " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libtsan:--pop-state}" \ + STATIC_LIBTSAN_LIBS + #else + #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS +@@ -835,10 +835,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 "}" \ +- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-liblsan:--push-state --no-as-needed}" \ + " -llsan " \ + " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-liblsan:--pop-state}" \ + STATIC_LIBLSAN_LIBS + #else + #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS +@@ -854,10 +854,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 "}" \ +- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libubsan:--push-state --no-as-needed}" \ + " -lubsan " \ + " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ +- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libubsan:--pop-state}" \ + STATIC_LIBUBSAN_LIBS + #else + #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0019-aarch64-disable-multilib-support.patch b/cross/gcc-x86_64/0019-aarch64-disable-multilib-support.patch deleted file mode 100644 index 5a8148feb..000000000 --- a/cross/gcc-x86_64/0019-aarch64-disable-multilib-support.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 41d00a2eb0754acf71958808bd17dbebeb517b84 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:12:55 +0000 -Subject: [PATCH 19/35] aarch64: disable multilib support - -multilib is unsupported on Alpine GCC ---- - gcc/config/aarch64/t-aarch64-linux | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux -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 - LIB1ASMFUNCS = _aarch64_sync_cache_range - - AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) --MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) -+MULTILIB_OSDIRNAMES = mabi.lp64=../lib - 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.41.0 - diff --git a/cross/gcc-x86_64/0020-aarch64-disable-multilib-support.patch b/cross/gcc-x86_64/0020-aarch64-disable-multilib-support.patch new file mode 100644 index 000000000..f2ad4bd64 --- /dev/null +++ b/cross/gcc-x86_64/0020-aarch64-disable-multilib-support.patch @@ -0,0 +1,26 @@ +From 0ca7f92018d0bc04a72655f3b130c9aaeea1b771 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:12:55 +0000 +Subject: [PATCH] aarch64: disable multilib support + +multilib is unsupported on Alpine GCC +--- + gcc/config/aarch64/t-aarch64-linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux +index 70e36b3299e..e00c3becd3f 100644 +--- a/gcc/config/aarch64/t-aarch64-linux ++++ b/gcc/config/aarch64/t-aarch64-linux +@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = mabi.lp64=../lib + 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.50.1 + diff --git a/cross/gcc-x86_64/0020-s390x-disable-multilib-support.patch b/cross/gcc-x86_64/0020-s390x-disable-multilib-support.patch deleted file mode 100644 index ef2f449a4..000000000 --- a/cross/gcc-x86_64/0020-s390x-disable-multilib-support.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 85b42bfbba71616831d14360b16998acb28790fd Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:13:59 +0000 -Subject: [PATCH 20/35] s390x: disable multilib support - -multilib is not supported on Alpine GCC at present ---- - gcc/config/s390/t-linux64 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64 -index cc6ab367072..7f498ee1cdc 100644 ---- a/gcc/config/s390/t-linux64 -+++ b/gcc/config/s390/t-linux64 -@@ -7,5 +7,5 @@ - - MULTILIB_OPTIONS = m64/m31 - MULTILIB_DIRNAMES = 64 32 --MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu) --MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 --- -2.41.0 - diff --git a/cross/gcc-x86_64/0021-ppc64-le-disable-multilib-support.patch b/cross/gcc-x86_64/0021-ppc64-le-disable-multilib-support.patch deleted file mode 100644 index dbdc78828..000000000 --- a/cross/gcc-x86_64/0021-ppc64-le-disable-multilib-support.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 7b53df284242638e940c0155b6c21e88cea1f55b Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:14:33 +0000 -Subject: [PATCH 21/35] ppc64[le]: disable multilib support - -multilib is not presently supported on Alpine GCC ---- - gcc/config/rs6000/t-linux | 6 ++++-- - gcc/config/rs6000/t-linux64 | 4 ++-- - gcc/config/rs6000/t-linux64bele | 4 ++-- - gcc/config/rs6000/t-linux64lebe | 4 ++-- - 4 files changed, 10 insertions(+), 8 deletions(-) - -diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux -index 4e371255533..128c75c7d39 100644 ---- a/gcc/config/rs6000/t-linux -+++ b/gcc/config/rs6000/t-linux -@@ -2,7 +2,8 @@ - # or soft-float. - ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) - ifneq (,$(findstring powerpc64,$(target))) --MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - else - MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) - endif -@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target))) - MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) - endif - ifneq (,$(findstring powerpc64le,$(target))) --MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - endif - endif - -diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 -index 01a94242308..b3a76379c03 100644 ---- a/gcc/config/rs6000/t-linux64 -+++ b/gcc/config/rs6000/t-linux64 -@@ -28,8 +28,8 @@ - MULTILIB_OPTIONS := m64/m32 - MULTILIB_DIRNAMES := 64 32 - MULTILIB_EXTRA_OPTS := --MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) --MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - - rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc - $(COMPILE) $< -diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele -index 97c1ee6fb4d..08d72639cb6 100644 ---- a/gcc/config/rs6000/t-linux64bele -+++ b/gcc/config/rs6000/t-linux64bele -@@ -2,6 +2,6 @@ - - MULTILIB_OPTIONS += mlittle - MULTILIB_DIRNAMES += le --MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) --MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 - MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} -diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe -index 2e63bdb9fc9..c6e1c5db65d 100644 ---- a/gcc/config/rs6000/t-linux64lebe -+++ b/gcc/config/rs6000/t-linux64lebe -@@ -2,6 +2,6 @@ - - MULTILIB_OPTIONS += mbig - MULTILIB_DIRNAMES += be --MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) --MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) -+MULTILIB_OSDIRNAMES := m64=../lib -+MULTILIB_OSDIRNAMES += m32=../lib32 - MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} --- -2.41.0 - diff --git a/cross/gcc-x86_64/0021-s390x-disable-multilib-support.patch b/cross/gcc-x86_64/0021-s390x-disable-multilib-support.patch new file mode 100644 index 000000000..7b71aa3bc --- /dev/null +++ b/cross/gcc-x86_64/0021-s390x-disable-multilib-support.patch @@ -0,0 +1,25 @@ +From b48898c8fbd7828b81f407c74c25cf8e07fb73a4 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:13:59 +0000 +Subject: [PATCH] s390x: disable multilib support + +multilib is not supported on Alpine GCC at present +--- + gcc/config/s390/t-linux64 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64 +index cc6ab367072..7f498ee1cdc 100644 +--- a/gcc/config/s390/t-linux64 ++++ b/gcc/config/s390/t-linux64 +@@ -7,5 +7,5 @@ + + MULTILIB_OPTIONS = m64/m31 + MULTILIB_DIRNAMES = 64 32 +-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu) +-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0022-ppc64-le-disable-multilib-support.patch b/cross/gcc-x86_64/0022-ppc64-le-disable-multilib-support.patch new file mode 100644 index 000000000..5281a006c --- /dev/null +++ b/cross/gcc-x86_64/0022-ppc64-le-disable-multilib-support.patch @@ -0,0 +1,81 @@ +From 158d93ce86f3d311ce489d0740326027068ca721 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:14:33 +0000 +Subject: [PATCH] ppc64[le]: disable multilib support + +multilib is not presently supported on Alpine GCC +--- + gcc/config/rs6000/t-linux | 6 ++++-- + gcc/config/rs6000/t-linux64 | 4 ++-- + gcc/config/rs6000/t-linux64bele | 4 ++-- + gcc/config/rs6000/t-linux64lebe | 4 ++-- + 4 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux +index 4e371255533..128c75c7d39 100644 +--- a/gcc/config/rs6000/t-linux ++++ b/gcc/config/rs6000/t-linux +@@ -2,7 +2,8 @@ + # or soft-float. + ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) + ifneq (,$(findstring powerpc64,$(target))) +-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + else + MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) + endif +@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target))) + MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) + endif + ifneq (,$(findstring powerpc64le,$(target))) +-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + endif + endif + +diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 +index f56b47c268e..c5f757a6284 100644 +--- a/gcc/config/rs6000/t-linux64 ++++ b/gcc/config/rs6000/t-linux64 +@@ -28,8 +28,8 @@ + MULTILIB_OPTIONS := m64/m32 + MULTILIB_DIRNAMES := 64 32 + MULTILIB_EXTRA_OPTS := +-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) +-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + + rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc + $(COMPILE) $< +diff --git a/gcc/config/rs6000/t-linux64bele b/gcc/config/rs6000/t-linux64bele +index 97c1ee6fb4d..08d72639cb6 100644 +--- a/gcc/config/rs6000/t-linux64bele ++++ b/gcc/config/rs6000/t-linux64bele +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mlittle + MULTILIB_DIRNAMES += le +-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +diff --git a/gcc/config/rs6000/t-linux64lebe b/gcc/config/rs6000/t-linux64lebe +index 2e63bdb9fc9..c6e1c5db65d 100644 +--- a/gcc/config/rs6000/t-linux64lebe ++++ b/gcc/config/rs6000/t-linux64lebe +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mbig + MULTILIB_DIRNAMES += be +-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES := m64=../lib ++MULTILIB_OSDIRNAMES += m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0022-x86_64-disable-multilib-support.patch b/cross/gcc-x86_64/0022-x86_64-disable-multilib-support.patch deleted file mode 100644 index 2b2f3e7f3..000000000 --- a/cross/gcc-x86_64/0022-x86_64-disable-multilib-support.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 96e7e1e9a899d9bb5fcbdf788bd529d0390c626f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Thu, 6 Jan 2022 03:14:54 +0000 -Subject: [PATCH 22/35] x86_64: disable multilib support - -multilib is not presently supported on Alpine GCC ---- - gcc/config/i386/t-linux64 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 -index 138956b0962..bc03dab874f 100644 ---- a/gcc/config/i386/t-linux64 -+++ b/gcc/config/i386/t-linux64 -@@ -33,6 +33,6 @@ - comma=, - MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) - MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) --MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) --MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 - MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) --- -2.41.0 - diff --git a/cross/gcc-x86_64/0023-riscv-disable-multilib-support.patch b/cross/gcc-x86_64/0023-riscv-disable-multilib-support.patch deleted file mode 100644 index eb9ba90fc..000000000 --- a/cross/gcc-x86_64/0023-riscv-disable-multilib-support.patch +++ /dev/null @@ -1,71 +0,0 @@ -From b26224acf342eacb33491f6ea0da1faf73d35715 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Mon, 3 Jan 2022 07:14:48 +0100 -Subject: [PATCH 23/35] riscv: disable multilib support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From the musl wiki [1]: - - musl does not support sharing an include directory between archs - […], and thus is not compatible with GCC-style multilib. It is - recommended that distributions build GCC with multilib disabled, - and use library directories named lib, not lib64 or lib32. - -For this reason, we patch existing GCC configuration files (gcc/config) -to pin MULTILIB_OSDIRNAMES to lib, there is also a corresponding GCC -upstream bug about this issue [2]. Avoiding the use of lib64 and lib32 -directories is a bit more difficult on the RISC-V architecture. This is -due to the fact that the default RISC-V configuration does not only use -the lib64 and lib32 directories but also subdirectories within these -directories for different RISC-V ABIs (e.g. lp64d, lp64, …) [3]. - -This patch aligns the RISC-V configuration with other architectures by -pinning MULTILIB_OSDIRNAMES to lib for rv64gc (our default RISC-V --march). Furthermore, this patch removes the ABI-specific startfile -prefix spec. Since both of these impact the default LIBRARY_PATH [4] -this patch thereby aligns the default RISC-V LIBRARY_PATH with that from -other Alpine architectures and thereby fixes #13369 [5]. - -Incidentally, this also fixes gccgo on riscv64, as without this patch -gccgo is otherwise not able to find the *.gox files for the Go standard -library. - -[1]: https://wiki.musl-libc.org/guidelines-for-distributions.html#Multilib/multi_arch -[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077 -[3]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103889#c14 -[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122 -[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369 ---- - gcc/config/riscv/linux.h | 8 -------- - gcc/config/riscv/t-linux | 7 +++++-- - 2 files changed, 5 insertions(+), 10 deletions(-) - ---- a/gcc/config/riscv/linux.h -+++ b/gcc/config/riscv/linux.h -@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see - %{rdynamic:-export-dynamic} \ - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ - %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}" -- --#define STARTFILE_PREFIX_SPEC \ -- "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ -- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ -- "/lib/ " \ -- "/usr/lib/ " -- --#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi ---- a/gcc/config/riscv/t-linux -+++ b/gcc/config/riscv/t-linux -@@ -1,5 +1,8 @@ --# Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ --MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) -+MULTILIB_OPTIONS := march=rv64gc -+MULTILIB_DIRNAMES := rv64gc -+ -+MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES))) - MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) -+MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc - - MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) diff --git a/cross/gcc-x86_64/0023-x86_64-disable-multilib-support.patch b/cross/gcc-x86_64/0023-x86_64-disable-multilib-support.patch new file mode 100644 index 000000000..1e74e9462 --- /dev/null +++ b/cross/gcc-x86_64/0023-x86_64-disable-multilib-support.patch @@ -0,0 +1,26 @@ +From 6957fc21caca80f5e01db15df6dc8de46c85167b Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Thu, 6 Jan 2022 03:14:54 +0000 +Subject: [PATCH] x86_64: disable multilib support + +multilib is not presently supported on Alpine GCC +--- + gcc/config/i386/t-linux64 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 +index 64a4a20e64f..9a8eb8dd8d1 100644 +--- a/gcc/config/i386/t-linux64 ++++ b/gcc/config/i386/t-linux64 +@@ -33,6 +33,6 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0024-always-build-libgcc_eh.a.patch b/cross/gcc-x86_64/0024-always-build-libgcc_eh.a.patch deleted file mode 100644 index 5d508ea08..000000000 --- a/cross/gcc-x86_64/0024-always-build-libgcc_eh.a.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a72e0613f79f6b6867819317accb7a714031a08c Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 24/35] always build libgcc_eh.a - -highly inspired by: - http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch ---- - libgcc/Makefile.in | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -967,8 +967,9 @@ ifneq ($(LIBUNWIND),) - all: libunwind.a - endif - -+all: libgcc_eh.a - ifeq ($(enable_shared),yes) --all: libgcc_eh.a libgcc_s$(SHLIB_EXT) -+all: libgcc_s$(SHLIB_EXT) - ifneq ($(LIBUNWIND),) - all: libunwind$(SHLIB_EXT) - libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1173,10 +1174,6 @@ install-libunwind: - install-shared: - $(mkinstalldirs) $(DESTDIR)$(inst_libdir) - -- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ -- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a -- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a -- - $(subst @multilib_dir@,$(MULTIDIR),$(subst \ - @shlib_base_name@,libgcc_s,$(subst \ - @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -1193,6 +1190,10 @@ ifeq ($(enable_gcov),yes) - $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a - endif - -+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ -+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a -+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a -+ - parts="$(INSTALL_PARTS)"; \ - for file in $$parts; do \ - rm -f $(DESTDIR)$(inst_libdir)/$$file; \ diff --git a/cross/gcc-x86_64/0024-riscv-disable-multilib-support.patch b/cross/gcc-x86_64/0024-riscv-disable-multilib-support.patch new file mode 100644 index 000000000..cc136a04f --- /dev/null +++ b/cross/gcc-x86_64/0024-riscv-disable-multilib-support.patch @@ -0,0 +1,78 @@ +From fdcbe7ee4ce81cdf247966385c8d521ac3f5a38c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Mon, 3 Jan 2022 07:14:48 +0100 +Subject: [PATCH] riscv: disable multilib support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From the musl wiki [1]: + + musl does not support sharing an include directory between archs + […], and thus is not compatible with GCC-style multilib. It is + recommended that distributions build GCC with multilib disabled, + and use library directories named lib, not lib64 or lib32. + +For this reason, we patch existing GCC configuration files (gcc/config) +to pin MULTILIB_OSDIRNAMES to lib, there is also a corresponding GCC +upstream bug about this issue [2]. Avoiding the use of lib64 and lib32 +directories is a bit more difficult on the RISC-V architecture. This is +due to the fact that the default RISC-V configuration does not only use +the lib64 and lib32 directories but also subdirectories within these +directories for different RISC-V ABIs (e.g. lp64d, lp64, …) [3]. + +This patch aligns the RISC-V configuration with other architectures by +pinning MULTILIB_OSDIRNAMES to lib for rv64gc (our default RISC-V +-march). Furthermore, this patch removes the ABI-specific startfile +prefix spec. Since both of these impact the default LIBRARY_PATH [4] +this patch thereby aligns the default RISC-V LIBRARY_PATH with that from +other Alpine architectures and thereby fixes #13369 [5]. + +Incidentally, this also fixes gccgo on riscv64, as without this patch +gccgo is otherwise not able to find the *.gox files for the Go standard +library. + +[1]: https://wiki.musl-libc.org/guidelines-for-distributions.html#Multilib/multi_arch +[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077 +[3]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103889#c14 +[4]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.c;h=d4c8746b0aa322286decf92aa72a12f0a393b655;hb=HEAD#l9122 +[5]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13369 +--- + gcc/config/riscv/linux.h | 8 -------- + gcc/config/riscv/t-linux | 7 +++++-- + 2 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 282c77b6a7b..07adae3d59c 100644 +--- a/gcc/config/riscv/linux.h ++++ b/gcc/config/riscv/linux.h +@@ -61,11 +61,3 @@ along with GCC; see the file COPYING3. If not see + %{rdynamic:-export-dynamic} \ + -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ + %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}" +- +-#define STARTFILE_PREFIX_SPEC \ +- "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ +- "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ +- "/lib/ " \ +- "/usr/lib/ " +- +-#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi +diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux +index a6f64f88d25..f88776ec520 100644 +--- a/gcc/config/riscv/t-linux ++++ b/gcc/config/riscv/t-linux +@@ -1,5 +1,8 @@ +-# Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ +-MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) ++MULTILIB_OPTIONS := march=rv64gc ++MULTILIB_DIRNAMES := rv64gc ++ ++MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib,$(MULTILIB_DIRNAMES))) + MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) ++MULTILIB_MATCHES := march?rv64gc=march?rv64imafdc + + MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0025-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-x86_64/0025-ada-libgnarl-compatibility-for-musl.patch deleted file mode 100644 index b7c1c5f2f..000000000 --- a/cross/gcc-x86_64/0025-ada-libgnarl-compatibility-for-musl.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 3ee8cbc1cad261b30d4a7a66d31496d5f243ce2f Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 25/35] ada: libgnarl compatibility for musl - ---- - gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ - gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- - 2 files changed, 3 insertions(+), 61 deletions(-) - -diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads -index 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 - PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; - -- function pthread_rwlockattr_setkind_np -- (attr : access pthread_rwlockattr_t; -- pref : int) return int; -- pragma Import -- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); -- - function pthread_rwlock_init - (mutex : access pthread_rwlock_t; - attr : access pthread_rwlockattr_t) return int; -@@ -470,11 +464,6 @@ package System.OS_Interface is - protocol : int) return int; - pragma Import (C, pthread_mutexattr_setprotocol); - -- function pthread_mutexattr_setprioceiling -- (attr : access pthread_mutexattr_t; -- prioceiling : int) return int; -- pragma Import (C, pthread_mutexattr_setprioceiling); -- - type struct_sched_param is record - 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 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 - pragma Import - (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); - -- function GNAT_has_cap_sys_nice return C.int; -- pragma Import -- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); - -- We do not have pragma Linker_Options ("-lcap"); here, because this - -- library is not present on many Linux systems. 'libcap' is the Linux - -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is - -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on - -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. - -- function Get_Ceiling_Support return Boolean; -- -- Get the value of the Ceiling_Support constant (see below). -- -- Note well: If this function or related code is modified, it should be -- -- tested by hand, because automated testing doesn't exercise it. -- -- ------------------------- -- -- Get_Ceiling_Support -- -- ------------------------- -- -- function Get_Ceiling_Support return Boolean is -- Ceiling_Support : Boolean := False; -- begin -- if Locking_Policy /= 'C' then -- return False; -- end if; -- -- declare -- function geteuid return Integer; -- pragma Import (C, geteuid, "geteuid"); -- Superuser : constant Boolean := geteuid = 0; -- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; -- pragma Assert (Has_Cap in 0 | 1); -- begin -- Ceiling_Support := Superuser or else Has_Cap = 1; -- end; -- -- return Ceiling_Support; -- end Get_Ceiling_Support; -- -- pragma Warnings (Off, "non-preelaborable call not allowed*"); -- Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-preelaborable call not allowed*"); - -- True if the locking policy is Ceiling_Locking, and the current process - -- has permission to use this policy. The process has permission if it is - -- running as 'root', or if the capability was set by the setcap command, -@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is - -- Init_Mutex -- - ---------------- - -+ pragma Warnings (Off, "formal parameter * is not referenced"); - function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is -+ pragma Warnings (On, "formal parameter * is not referenced"); - Mutex_Attr : aliased pthread_mutexattr_t; - Result, Result_2 : C.int; - -@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is - return Result; - end if; - -- if Ceiling_Support then -- Result := pthread_mutexattr_setprotocol -- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); -- pragma Assert (Result = 0); -- -- Result := pthread_mutexattr_setprioceiling -- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); -- pragma Assert (Result = 0); -- -- elsif Locking_Policy = 'I' then -+ if Locking_Policy = 'I' then - Result := pthread_mutexattr_setprotocol - (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); - pragma Assert (Result = 0); -@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is - Result := pthread_rwlockattr_init (RWlock_Attr'Access); - pragma Assert (Result = 0); - -- Result := pthread_rwlockattr_setkind_np -- (RWlock_Attr'Access, -- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); -- pragma Assert (Result = 0); -- - Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); - - pragma Assert (Result in 0 | ENOMEM); --- -2.41.0 - diff --git a/cross/gcc-x86_64/0025-always-build-libgcc_eh.a.patch b/cross/gcc-x86_64/0025-always-build-libgcc_eh.a.patch new file mode 100644 index 000000000..5b21d4dd1 --- /dev/null +++ b/cross/gcc-x86_64/0025-always-build-libgcc_eh.a.patch @@ -0,0 +1,51 @@ +From 6f63901256443978a2c3746e72bd5762166a7790 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:05:41 +0000 +Subject: [PATCH] always build libgcc_eh.a + +highly inspired by: + http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch +--- + libgcc/Makefile.in | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in +index 0719fd0615d..80bb8f1622f 100644 +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -971,8 +971,9 @@ ifneq ($(LIBUNWIND),) + all: libunwind.a + endif + ++all: libgcc_eh.a + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1177,10 +1178,6 @@ install-libunwind: + install-shared: + $(mkinstalldirs) $(DESTDIR)$(inst_libdir) + +- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ +- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a +- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a +- + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) +@@ -1197,6 +1194,10 @@ ifeq ($(enable_gcov),yes) + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a + endif + ++ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a ++ + parts="$(INSTALL_PARTS)"; \ + for file in $$parts; do \ + rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch b/cross/gcc-x86_64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch new file mode 100644 index 000000000..e8fb24481 --- /dev/null +++ b/cross/gcc-x86_64/0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch @@ -0,0 +1,59 @@ +From a365def37f5de93ad85588d8e2c02c0df28e88d6 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:09:02 -0700 +Subject: [PATCH] ada: libgnarl: remove use of glibc-specific + pthread_rwlockattr_setkind_np + +musl's thread library does not implement it + +Signed-off-by: Ariadne Conill +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 10 ---------- + gcc/ada/libgnarl/s-taprop__linux.adb | 7 ------- + 2 files changed, 17 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 7aeb15da523..5551b701e5a 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -402,16 +402,6 @@ package System.OS_Interface is + (attr : access pthread_rwlockattr_t) return int; + pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy"); + +- PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0; +- PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; +- +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb +index 8f4c835baa7..6df36c7d8f4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -409,16 +409,9 @@ package body System.Task_Primitives.Operations is + Result : C.int; + + begin +- -- Set the rwlock to prefer writer to avoid writers starvation +- + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0026-ada-musl-support-fixes.patch b/cross/gcc-x86_64/0026-ada-musl-support-fixes.patch deleted file mode 100644 index 0be683fa6..000000000 --- a/cross/gcc-x86_64/0026-ada-musl-support-fixes.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 3df4788c79c7429b196c7b284af2b4cf9a4b4f8d Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 26/35] ada: musl support fixes - ---- - gcc/ada/Makefile.rtl | 16 ++++++++-------- - gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- - gcc/ada/adaint.h | 10 ++++------ - gcc/ada/terminals.c | 8 ++++---- - 4 files changed, 35 insertions(+), 33 deletions(-) - ---- a/gcc/ada/Makefile.rtl -+++ b/gcc/ada/Makefile.rtl -@@ -1558,7 +1558,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) - s-intman.adb - #include - #endif -+ -+#if defined (linux) || defined(__linux__) -+#define _GNU_SOURCE 1 -+#include -+#endif - - #ifdef __PikeOS__ - #define __BSD_VISIBLE 1 -@@ -3465,7 +3470,6 @@ __gnat_lwp_self (void) - #endif - - #if defined (__linux__) --#include - - /* glibc versions earlier than 2.7 do not define the routines to handle - dynamically allocated CPU sets. For these targets, we use the static -@@ -3475,7 +3479,7 @@ __gnat_lwp_self (void) - - /* Dynamic cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count) - { - return CPU_ALLOC (count); -@@ -3488,33 +3492,33 @@ __gnat_cpu_alloc_size (size_t count) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { -- CPU_FREE (set); -+ CPU_FREE ((cpu_set_t *) set); - } - - void --__gnat_cpu_zero (size_t count, cpu_set_t *set) -+__gnat_cpu_zero (size_t count, void *set) - { -- CPU_ZERO_S (count, set); -+ CPU_ZERO_S (count, (cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET_S (cpu - 1, count, set); -+ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); - } - - #else /* !CPU_ALLOC */ - - /* Static cpu sets */ - --cpu_set_t * -+void * - __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) - { -- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); -+ return xmalloc (sizeof (cpu_set_t)); - } - - size_t -@@ -3524,23 +3528,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) - } - - void --__gnat_cpu_free (cpu_set_t *set) -+__gnat_cpu_free (void *set) - { - free (set); - } - - void --__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) - { -- CPU_ZERO (set); -+ CPU_ZERO ((cpu_set_t *) set); - } - - void --__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) -+__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) - { - /* Ada handles CPU numbers starting from 1, while C identifies the first - CPU by a 0, so we need to adjust. */ -- CPU_SET (cpu - 1, set); -+ CPU_SET (cpu - 1, (cpu_set_t *) set); - } - #endif /* !CPU_ALLOC */ - #endif /* __linux__ */ ---- a/gcc/ada/adaint.h -+++ b/gcc/ada/adaint.h -@@ -319,13 +319,11 @@ extern void *__gnat_lwp_self (void); - - /* Routines for interface to required CPU set primitives */ - --#include -- --extern cpu_set_t *__gnat_cpu_alloc (size_t); -+extern void * __gnat_cpu_alloc (size_t); - extern size_t __gnat_cpu_alloc_size (size_t); --extern void __gnat_cpu_free (cpu_set_t *); --extern void __gnat_cpu_zero (size_t, cpu_set_t *); --extern void __gnat_cpu_set (int, size_t, cpu_set_t *); -+extern void __gnat_cpu_free (void *); -+extern void __gnat_cpu_zero (size_t, void *); -+extern void __gnat_cpu_set (int, size_t, void *); - #endif - - #if defined (_WIN32) ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1134,7 +1134,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) -- 2- getpt (USE_GETPT) -+ 2- posix_openpt (USE_POSIX_OPENPT) - 3- openpty (USE_OPENPTY) - - When using the cloning device method, the macro USE_CLONE_DEVICE should -@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, - #if defined (__APPLE__) || defined (BSD) - #define USE_OPENPTY - #elif defined (__linux__) --#define USE_GETPT -+#define USE_POSIX_OPENPT - #elif defined (__sun__) - #define USE_CLONE_DEVICE "/dev/ptmx" - #elif defined (_AIX) -@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { - int master_fd = -1; - char *slave_name = NULL; - --#ifdef USE_GETPT -- master_fd = getpt (); -+#if defined(USE_POSIX_OPENPT) -+ master_fd = posix_openpt(O_RDWR | O_NOCTTY); - #elif defined (USE_OPENPTY) - status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); - #elif defined (USE_CLONE_DEVICE) diff --git a/cross/gcc-x86_64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch b/cross/gcc-x86_64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch new file mode 100644 index 000000000..c138a6034 --- /dev/null +++ b/cross/gcc-x86_64/0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch @@ -0,0 +1,50 @@ +From e1572457f94a26da9a588a36afa3eb0e74122c34 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:13:19 -0700 +Subject: [PATCH] ada: libgnarl: use posix_openpt instead of glibc-specific + getpt to open a pty + +musl only implements posix_openpt(3), not the older glibc-specific getpt() +and glibc implements both for ages. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/terminals.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index 89f887556c0..93557fe2631 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1134,7 +1134,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) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1148,7 +1148,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, + #if defined (__APPLE__) || defined (BSD) + #define USE_OPENPTY + #elif defined (__linux__) +-#define USE_GETPT ++#define USE_POSIX_OPENPT + #elif defined (__sun__) + #define USE_CLONE_DEVICE "/dev/ptmx" + #elif defined (_AIX) +@@ -1197,8 +1197,8 @@ allocate_pty_desc (pty_desc **desc) { + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-x86_64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch deleted file mode 100644 index 0b92854c4..000000000 --- a/cross/gcc-x86_64/0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +++ /dev/null @@ -1,235 +0,0 @@ -From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001 -From: Drew DeVault -Date: Wed, 9 Dec 2020 07:42:06 +0000 -Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in - LINK_GCC_C_SEQUENCE_SPEC [PR81358] - -This fixes issues with RISC-V. ---- - Makefile.in | 1 + - gcc/config/gnu-user.h | 12 +++++++++++- - gcc/config.in | 6 ++++++ - 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(+), 5 deletions(-) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -237,6 +237,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; \ -+ TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \ - HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ - GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ - GMPINC="$(HOST_GMPINC)"; export GMPINC; \ ---- 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 - #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " - #endif - -+#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) -+# ifdef LD_AS_NEEDED_OPTION -+# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION -+# else -+# define LINK_LIBATOMIC_SPEC "-latomic" -+# endif -+#elif !defined(LINK_LIBATOMIC_SPEC) -+# define LINK_LIBATOMIC_SPEC "" -+#endif -+ - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ -- "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ -+ "%{static|static-pie:--start-group} %G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L} \ - %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" - - #undef LINK_GCC_C_SEQUENCE_SPEC ---- a/gcc/config.in -+++ b/gcc/config.in -@@ -131,6 +131,12 @@ - #endif - - -+/* Define if libatomic should always be linked. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_AUTOLINK_LIBATOMIC -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET ---- a/gcc/configure -+++ b/gcc/configure -@@ -1002,6 +1002,7 @@ with_changes_root_url - enable_languages - with_multilib_list - with_multilib_generator -+enable_autolink_libatomic - with_zstd - with_zstd_include - with_zstd_lib -@@ -1739,6 +1740,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 -+ --enable-autolink-libatomic -+ enable automatic linking of libatomic (ignored if -+ not built) - --disable-rpath do not hardcode runtime library paths - --enable-sjlj-exceptions - arrange to use setjmp/longjmp exception handling -@@ -8380,7 +8384,6 @@ else - fi - - -- - # Check whether --with-multilib-generator was given. - if test "${with_multilib_generator+set}" = set; then : - withval=$with_multilib_generator; : -@@ -8388,6 +8391,32 @@ else - with_multilib_generator=default - fi - -+# If libatomic is available, whether it should be linked automatically -+# Check whether --enable-autolink-libatomic was given. -+if test "${enable_autolink_libatomic+set}" = set; then : -+ enableval=$enable_autolink_libatomic; -+ case $enable_autolink_libatomic in -+ yes | no) ;; -+ *) as_fn_error $? "'$enable_autolink_libatomic' is an invalid value for -+--enable-autolink-libatomic. Valid choices are 'yes' and 'no'." "$LINENO" 5 ;; -+ esac -+ -+else -+ enable_autolink_libatomic='' -+fi -+ -+ -+if test x$enable_autolink_libatomic = xyes; then -+ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then -+ -+$as_echo "#define ENABLE_AUTOLINK_LIBATOMIC 1" >>confdefs.h -+ -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&5 -+$as_echo "$as_me: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&2;} -+ fi -+fi -+ - - # ------------------------- - # Checks for other programs ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -1215,6 +1215,27 @@ AC_ARG_WITH(multilib-generator, - :, - with_multilib_generator=default) - -+# If libatomic is available, whether it should be linked automatically -+AC_ARG_ENABLE(autolink-libatomic, -+[AS_HELP_STRING([--enable-autolink-libatomic], -+ [enable automatic linking of libatomic (ignored if not built)])], -+[ -+ case $enable_autolink_libatomic in -+ yes | no) ;; -+ *) AC_MSG_ERROR(['$enable_autolink_libatomic' is an invalid value for -+--enable-autolink-libatomic. Valid choices are 'yes' and 'no'.]) ;; -+ esac -+], [enable_autolink_libatomic='']) -+ -+if test x$enable_autolink_libatomic = xyes; then -+ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then -+ AC_DEFINE(ENABLE_AUTOLINK_LIBATOMIC, 1, -+ [Define if libatomic should always be linked.]) -+ else -+ AC_MSG_WARN([libatomic is not build for this target, --enable-autolink-libatomic ignored]) -+ fi -+fi -+ - # ------------------------- - # Checks for other programs - # ------------------------- ---- a/gcc/doc/install.texi -+++ b/gcc/doc/install.texi -@@ -2525,6 +2525,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}. - -+@item --enable-autolink-libatomic -+@itemx --disable-autolink-libatomic -+Tell GCC that it should automatically link libatomic; if supported by -+the linker, the file is only linked as needed. This flag is ignored -+when libatomic is not built. Note that this conigure flag is in particular -+useful when building an offloading-target compiler; as for those, a -+user had to specify @code{-foffload=target=-latomic} otherwise. -+ - @item --with-glibc-version=@var{major}.@var{minor} - 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 ---- a/gcc/doc/tm.texi -+++ b/gcc/doc/tm.texi -@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. - - @defmac LINK_GCC_C_SEQUENCE_SPEC - The sequence in which libgcc and libc are specified to the linker. --By default this is @code{%G %L %G}. -+By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. -+@end defmac -+ -+@defmac LINK_LIBATOMIC_SPEC -+This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link -+libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} -+is set. - @end defmac - - @defmac POST_LINK_SPEC ---- a/gcc/doc/tm.texi.in -+++ b/gcc/doc/tm.texi.in -@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. - - @defmac LINK_GCC_C_SEQUENCE_SPEC - The sequence in which libgcc and libc are specified to the linker. --By default this is @code{%G %L %G}. -+By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. -+@end defmac -+ -+@defmac LINK_LIBATOMIC_SPEC -+This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link -+libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} -+is set. - @end defmac - - @defmac POST_LINK_SPEC ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -991,13 +991,23 @@ proper position among the other output files. */ - # define ASM_DEBUG_OPTION_SPEC "" - #endif - -+#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) -+# ifdef LD_AS_NEEDED_OPTION -+# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION -+# else -+# define LINK_LIBATOMIC_SPEC "-latomic" -+# endif -+#elif !defined(LINK_LIBATOMIC_SPEC) -+# define LINK_LIBATOMIC_SPEC "" -+#endif -+ - /* Here is the spec for running the linker, after compiling all files. */ - - /* This is overridable by the target in case they need to specify the - -lgcc and -lc order specially, yet not require them to override all - of LINK_COMMAND_SPEC. */ - #ifndef LINK_GCC_C_SEQUENCE_SPEC --#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" -+#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L %G}" - #endif - - #ifdef ENABLE_DEFAULT_SSP diff --git a/cross/gcc-x86_64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch b/cross/gcc-x86_64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch new file mode 100644 index 000000000..0bf61bd9f --- /dev/null +++ b/cross/gcc-x86_64/0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch @@ -0,0 +1,54 @@ +From 4f26d4bfedb7f942b69ca4743f053c3a690a0b4a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 25 Jul 2025 02:18:49 -0700 +Subject: [PATCH] ada: libgnarl: adaint: fix sched.h inclusion for musl + +Signed-off-by: Ariadne Conill +--- + gcc/ada/adaint.c | 6 +++++- + gcc/ada/adaint.h | 5 +++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 1fcfae165a7..67318e647ed 100644 +--- a/gcc/ada/adaint.c ++++ b/gcc/ada/adaint.c +@@ -95,6 +95,11 @@ + #include + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 + #endif +@@ -3476,7 +3481,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 3df12b5f956..26a489f2b78 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -40,6 +40,11 @@ extern "C" { + #include "mingw32.h" + #endif + ++#if defined (linux) || defined(__linux__) ++#define _GNU_SOURCE 1 ++#include ++#endif ++ + #include + + /* Constants used for the form parameter encoding values */ +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-x86_64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch deleted file mode 100644 index f92fc7bf4..000000000 --- a/cross/gcc-x86_64/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Sun, 29 Aug 2021 12:23:34 +0200 -Subject: [PATCH 28/35] 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 -which builtins are available on riscv64. This then causes incorrect code -generation for libatomic since it assumes compiler builtins to be -available which are not actually available on riscv64. - -This commit fixes this issue by disabling linking of libatomic configure -test code entirely, thereby preventing linking against libatomic. - -See: - -* https://gitlab.alpinelinux.org/alpine/aports/-/issues/12948 -* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c6 ---- - libatomic/configure.tgt | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt -index a92ae9e8309..90b579ca4d8 100644 ---- a/libatomic/configure.tgt -+++ b/libatomic/configure.tgt -@@ -30,6 +30,26 @@ - # on ${target_cpu}. For example to allow proper use of multilibs. - configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" - -+# The libatomic configure script performs several checks to determine -+# whether builtins for atomic operations are available. When compiling -+# with --enable-autolink-libatomic the test code compiled by the -+# configure script is also linked against libatomic. This causes it -+# to think that builtins are available, even if there are not, since -+# the tested symbols are provided by libatomic. -+# -+# This is a hack to ensure that we don't link against libatomic by not -+# linking any configure test code at all when --enable-autolink-libatomic -+# is given. -+# -+# See: -+# -+# * https://gitlab.alpinelinux.org/alpine/aports/-/issues/12817 -+# * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c4 -+# -+if test x$enable_autolink_libatomic = xyes; then -+ gcc_no_link=yes -+fi -+ - case "${target_cpu}" in - alpha*) - # fenv.c needs this option to generate inexact exceptions. --- -2.41.0 - diff --git a/cross/gcc-x86_64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch b/cross/gcc-x86_64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch new file mode 100644 index 000000000..32c8c8724 --- /dev/null +++ b/cross/gcc-x86_64/0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch @@ -0,0 +1,256 @@ +From 6592e702844d31bcef17c340bfc13e0e1be9f132 Mon Sep 17 00:00:00 2001 +From: Drew DeVault +Date: Wed, 9 Dec 2020 07:42:06 +0000 +Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in + LINK_GCC_C_SEQUENCE_SPEC [PR81358] + +This fixes issues with RISC-V. +--- + Makefile.in | 1 + + gcc/config.in | 6 ++++++ + gcc/config/gnu-user.h | 12 +++++++++++- + 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(+), 5 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 1e039c20550..20f535a306a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -238,6 +238,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; \ ++ TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \ + HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \ + GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ + GMPINC="$(HOST_GMPINC)"; export GMPINC; \ +diff --git a/gcc/config.in b/gcc/config.in +index 8a531ed591c..40045ff35a5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -131,6 +131,12 @@ + #endif + + ++/* Define if libatomic should always be linked. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_AUTOLINK_LIBATOMIC ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 3c17ac6eade..0426efdb8c3 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 + #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " + #endif + ++#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) ++# ifdef LD_AS_NEEDED_OPTION ++# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION ++# else ++# define LINK_LIBATOMIC_SPEC "-latomic" ++# endif ++#elif !defined(LINK_LIBATOMIC_SPEC) ++# define LINK_LIBATOMIC_SPEC "" ++#endif ++ + #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ +- "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ ++ "%{static|static-pie:--start-group} %G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L} \ + %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" + + #undef LINK_GCC_C_SEQUENCE_SPEC +diff --git a/gcc/configure b/gcc/configure +index 343563c8948..54300a2a867 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -1003,6 +1003,7 @@ with_changes_root_url + enable_languages + with_multilib_list + with_multilib_generator ++enable_autolink_libatomic + with_zstd + with_zstd_include + with_zstd_lib +@@ -1742,6 +1743,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 ++ --enable-autolink-libatomic ++ enable automatic linking of libatomic (ignored if ++ not built) + --disable-rpath do not hardcode runtime library paths + --enable-sjlj-exceptions + arrange to use setjmp/longjmp exception handling +@@ -8400,7 +8404,6 @@ else + fi + + +- + # Check whether --with-multilib-generator was given. + if test "${with_multilib_generator+set}" = set; then : + withval=$with_multilib_generator; : +@@ -8408,6 +8411,32 @@ else + with_multilib_generator=default + fi + ++# If libatomic is available, whether it should be linked automatically ++# Check whether --enable-autolink-libatomic was given. ++if test "${enable_autolink_libatomic+set}" = set; then : ++ enableval=$enable_autolink_libatomic; ++ case $enable_autolink_libatomic in ++ yes | no) ;; ++ *) as_fn_error $? "'$enable_autolink_libatomic' is an invalid value for ++--enable-autolink-libatomic. Valid choices are 'yes' and 'no'." "$LINENO" 5 ;; ++ esac ++ ++else ++ enable_autolink_libatomic='' ++fi ++ ++ ++if test x$enable_autolink_libatomic = xyes; then ++ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then ++ ++$as_echo "#define ENABLE_AUTOLINK_LIBATOMIC 1" >>confdefs.h ++ ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&5 ++$as_echo "$as_me: WARNING: libatomic is not build for this target, --enable-autolink-libatomic ignored" >&2;} ++ fi ++fi ++ + + # ------------------------- + # Checks for other programs +diff --git a/gcc/configure.ac b/gcc/configure.ac +index b3948469d17..81c070830e2 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1227,6 +1227,27 @@ AC_ARG_WITH(multilib-generator, + :, + with_multilib_generator=default) + ++# If libatomic is available, whether it should be linked automatically ++AC_ARG_ENABLE(autolink-libatomic, ++[AS_HELP_STRING([--enable-autolink-libatomic], ++ [enable automatic linking of libatomic (ignored if not built)])], ++[ ++ case $enable_autolink_libatomic in ++ yes | no) ;; ++ *) AC_MSG_ERROR(['$enable_autolink_libatomic' is an invalid value for ++--enable-autolink-libatomic. Valid choices are 'yes' and 'no'.]) ;; ++ esac ++], [enable_autolink_libatomic='']) ++ ++if test x$enable_autolink_libatomic = xyes; then ++ if echo " ${TARGET_CONFIGDIRS} " | grep " libatomic " > /dev/null 2>&1 ; then ++ AC_DEFINE(ENABLE_AUTOLINK_LIBATOMIC, 1, ++ [Define if libatomic should always be linked.]) ++ else ++ AC_MSG_WARN([libatomic is not build for this target, --enable-autolink-libatomic ignored]) ++ fi ++fi ++ + # ------------------------- + # Checks for other programs + # ------------------------- +diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi +index 3e9e09b4ae3..6e7b756be61 100644 +--- a/gcc/doc/install.texi ++++ b/gcc/doc/install.texi +@@ -2617,6 +2617,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}. + ++@item --enable-autolink-libatomic ++@itemx --disable-autolink-libatomic ++Tell GCC that it should automatically link libatomic; if supported by ++the linker, the file is only linked as needed. This flag is ignored ++when libatomic is not built. Note that this conigure flag is in particular ++useful when building an offloading-target compiler; as for those, a ++user had to specify @code{-foffload=target=-latomic} otherwise. ++ + @item --with-glibc-version=@var{major}.@var{minor} + 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 a96700c0d38..16deedca64d 100644 +--- a/gcc/doc/tm.texi ++++ b/gcc/doc/tm.texi +@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. + + @defmac LINK_GCC_C_SEQUENCE_SPEC + The sequence in which libgcc and libc are specified to the linker. +-By default this is @code{%G %L %G}. ++By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. ++@end defmac ++ ++@defmac LINK_LIBATOMIC_SPEC ++This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link ++libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} ++is set. + @end defmac + + @defmac POST_LINK_SPEC +diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in +index eccc4d88493..4ca4c610571 100644 +--- a/gcc/doc/tm.texi.in ++++ b/gcc/doc/tm.texi.in +@@ -390,7 +390,13 @@ the argument @option{-lgcc} to tell the linker to do the search. + + @defmac LINK_GCC_C_SEQUENCE_SPEC + The sequence in which libgcc and libc are specified to the linker. +-By default this is @code{%G %L %G}. ++By default this is @code{%G LINK_LIBATOMIC_SPEC %L %G}. ++@end defmac ++ ++@defmac LINK_LIBATOMIC_SPEC ++This macro is used in the default @code{LINK_GCC_C_SEQUENCE_SPEC} to link ++libatomic. By default, it is unset unless @code{ENABLE_AUTOLINK_LIBATOMIC} ++is set. + @end defmac + + @defmac POST_LINK_SPEC +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index 607c8ca1d42..e9f78f0f4c1 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1000,13 +1000,23 @@ proper position among the other output files. */ + # define ASM_DEBUG_OPTION_SPEC "" + #endif + ++#if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) ++# ifdef LD_AS_NEEDED_OPTION ++# define LINK_LIBATOMIC_SPEC LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION ++# else ++# define LINK_LIBATOMIC_SPEC "-latomic" ++# endif ++#elif !defined(LINK_LIBATOMIC_SPEC) ++# define LINK_LIBATOMIC_SPEC "" ++#endif ++ + /* Here is the spec for running the linker, after compiling all files. */ + + /* This is overridable by the target in case they need to specify the + -lgcc and -lc order specially, yet not require them to override all + of LINK_COMMAND_SPEC. */ + #ifndef LINK_GCC_C_SEQUENCE_SPEC +-#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" ++#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:" LINK_LIBATOMIC_SPEC " %L %G}" + #endif + + #ifdef ENABLE_DEFAULT_SSP +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-x86_64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch deleted file mode 100644 index 4418cd5b5..000000000 --- a/cross/gcc-x86_64/0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 430c701a3cefbe09a9c7c8a2f5bbe957f9b2ecb2 Mon Sep 17 00:00:00 2001 -From: Samuel Holland -Date: Thu, 30 Jun 2022 16:44:51 +0000 -Subject: [PATCH 29/35] 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 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 - // Currently, the generic model only supports the "C" locale. - // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html - __cloc = 0; -- if (strcmp(__s, "C")) -- __throw_runtime_error(__N("locale::facet::_S_create_c_locale " -- "name not valid")); - } - - void --- -2.41.0 - diff --git a/cross/gcc-x86_64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch b/cross/gcc-x86_64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch new file mode 100644 index 000000000..5aed9caf5 --- /dev/null +++ b/cross/gcc-x86_64/0030-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -0,0 +1,57 @@ +From 952070c1616f231a810af2da50264713d7587b48 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sun, 29 Aug 2021 12:23:34 +0200 +Subject: [PATCH] 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 +which builtins are available on riscv64. This then causes incorrect code +generation for libatomic since it assumes compiler builtins to be +available which are not actually available on riscv64. + +This commit fixes this issue by disabling linking of libatomic configure +test code entirely, thereby preventing linking against libatomic. + +See: + +* https://gitlab.alpinelinux.org/alpine/aports/-/issues/12948 +* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c6 +--- + libatomic/configure.tgt | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt +index 6db039d6e8b..2751b5c1387 100644 +--- a/libatomic/configure.tgt ++++ b/libatomic/configure.tgt +@@ -30,6 +30,26 @@ + # on ${target_cpu}. For example to allow proper use of multilibs. + configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" + ++# The libatomic configure script performs several checks to determine ++# whether builtins for atomic operations are available. When compiling ++# with --enable-autolink-libatomic the test code compiled by the ++# configure script is also linked against libatomic. This causes it ++# to think that builtins are available, even if there are not, since ++# the tested symbols are provided by libatomic. ++# ++# This is a hack to ensure that we don't link against libatomic by not ++# linking any configure test code at all when --enable-autolink-libatomic ++# is given. ++# ++# See: ++# ++# * https://gitlab.alpinelinux.org/alpine/aports/-/issues/12817 ++# * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c4 ++# ++if test x$enable_autolink_libatomic = xyes; then ++ gcc_no_link=yes ++fi ++ + case "${target_cpu}" in + alpha*) + # fenv.c needs this option to generate inexact exceptions. +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-x86_64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch deleted file mode 100644 index fde874c35..000000000 --- a/cross/gcc-x86_64/0030-gdc-unconditionally-link-libgphobos-against-libucont.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 05f0043755f341a2ff4f845379327076b3e0203d Mon Sep 17 00:00:00 2001 -From: Mathias LANG -Date: Mon, 17 Jan 2022 03:49:21 +0000 -Subject: [PATCH 30/35] gdc: unconditionally link libgphobos against - libucontext - -ref: alpine/aports#13422 ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -54362,7 +54362,7 @@ configure-target-libphobos: - esac; \ - module_srcdir=libphobos; \ - rm -f no-such-file || : ; \ -- CONFIG_SITE=no-such-file $(SHELL) \ -+ CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \ - $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ diff --git a/cross/gcc-x86_64/0031-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-x86_64/0031-druntime-link-against-libucontext-on-all-platforms.patch deleted file mode 100644 index 72f9370ee..000000000 --- a/cross/gcc-x86_64/0031-druntime-link-against-libucontext-on-all-platforms.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0b89a74fbf77ae6917f043c79cd03db0d6ef0212 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Sat, 16 Jul 2022 09:21:11 +0200 -Subject: [PATCH 31/35] druntime: link against libucontext on all platforms - -On musl-based Linux distributions, swapcontext etc. are not provided by -musl but instead by libucontext. Hence, we _always_ need to link against -an external library for these functions. ---- - libphobos/configure | 8 -------- - libphobos/m4/druntime/libraries.m4 | 8 -------- - 2 files changed, 16 deletions(-) - ---- a/libphobos/configure -+++ b/libphobos/configure -@@ -15375,14 +15375,6 @@ fi - # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to - # "yes" for targets that have 'version = AsmExternal'. - druntime_fiber_asm_external=no -- case "$target_cpu" in -- aarch64* | \ -- arm* | \ -- i[34567]86|x86_64 | \ -- powerpc) -- druntime_fiber_asm_external=yes -- ;; -- esac - if test "$druntime_fiber_asm_external" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 - $as_echo_n "checking for library containing swapcontext... " >&6; } ---- a/libphobos/m4/druntime/libraries.m4 -+++ b/libphobos/m4/druntime/libraries.m4 -@@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], - # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to - # "yes" for targets that have 'version = AsmExternal'. - druntime_fiber_asm_external=no -- case "$target_cpu" in -- aarch64* | \ -- arm* | \ -- i[[34567]]86|x86_64 | \ -- powerpc) -- druntime_fiber_asm_external=yes -- ;; -- esac - if test "$druntime_fiber_asm_external" = no; then - AC_SEARCH_LIBS([swapcontext], [c ucontext], [], - AC_MSG_ERROR([swapcontext required but not found])) diff --git a/cross/gcc-x86_64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch b/cross/gcc-x86_64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch new file mode 100644 index 000000000..2b7259a4d --- /dev/null +++ b/cross/gcc-x86_64/0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch @@ -0,0 +1,27 @@ +From 896b002a2afacb4d75d573aca4ae53b499df19cd Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Thu, 30 Jun 2022 16:44:51 +0000 +Subject: [PATCH] libstdc++: do not throw exceptions for non-C locales on musl + targets + +--- + libstdc++-v3/config/locale/generic/c_locale.cc | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc +index bfd02b5c2c6..16f9e84d66f 100644 +--- a/libstdc++-v3/config/locale/generic/c_locale.cc ++++ b/libstdc++-v3/config/locale/generic/c_locale.cc +@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + // Currently, the generic model only supports the "C" locale. + // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html + __cloc = 0; +- if (strcmp(__s, "C")) +- __throw_runtime_error(__N("locale::facet::_S_create_c_locale " +- "name not valid")); + } + + void +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch b/cross/gcc-x86_64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch new file mode 100644 index 000000000..452ced2ee --- /dev/null +++ b/cross/gcc-x86_64/0032-gdc-unconditionally-link-libgphobos-against-libucont.patch @@ -0,0 +1,26 @@ +From 22d69ae3e2768d301ef5a1f1b362c25cf8bf27b9 Mon Sep 17 00:00:00 2001 +From: Mathias LANG +Date: Mon, 17 Jan 2022 03:49:21 +0000 +Subject: [PATCH] gdc: unconditionally link libgphobos against libucontext + +ref: alpine/aports#13422 +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 20f535a306a..c087bfe7cd4 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -54382,7 +54382,7 @@ configure-target-libphobos: + esac; \ + module_srcdir=libphobos; \ + rm -f no-such-file || : ; \ +- CONFIG_SITE=no-such-file $(SHELL) \ ++ CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \ + $$s/$$module_srcdir/configure \ + --srcdir=$${topdir}/$$module_srcdir \ + $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-x86_64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch deleted file mode 100644 index b53e5847d..000000000 --- a/cross/gcc-x86_64/0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +++ /dev/null @@ -1,20 +0,0 @@ -From eeec799f43fbd0bfffc13594585b39d708972511 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=B6ren=20Tempel?= -Date: Tue, 19 Jul 2022 14:54:07 +0200 -Subject: [PATCH 32/35] libgnat: time_t is always 64-bit on musl libc - ---- - gcc/ada/libgnat/s-parame.ads | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/gcc/ada/libgnat/s-parame.ads -+++ b/gcc/ada/libgnat/s-parame.ads -@@ -100,7 +100,7 @@ package System.Parameters is - -- Characteristics of time_t type -- - ------------------------------------ - -- time_t_bits : constant := Long_Integer'Size; -+ time_t_bits : constant := Long_Long_Integer'Size; - -- Number of bits in type time_t - - ---------------------------------------------- diff --git a/cross/gcc-x86_64/0033-druntime-link-against-libucontext-on-all-platforms.patch b/cross/gcc-x86_64/0033-druntime-link-against-libucontext-on-all-platforms.patch new file mode 100644 index 000000000..920cf677e --- /dev/null +++ b/cross/gcc-x86_64/0033-druntime-link-against-libucontext-on-all-platforms.patch @@ -0,0 +1,54 @@ +From dc66835022cf68085400f2eed30614c5afdc28a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sat, 16 Jul 2022 09:21:11 +0200 +Subject: [PATCH] druntime: link against libucontext on all platforms + +On musl-based Linux distributions, swapcontext etc. are not provided by +musl but instead by libucontext. Hence, we _always_ need to link against +an external library for these functions. +--- + libphobos/configure | 8 -------- + libphobos/m4/druntime/libraries.m4 | 8 -------- + 2 files changed, 16 deletions(-) + +diff --git a/libphobos/configure b/libphobos/configure +index 4f5be7d4ff4..0a48032edb4 100755 +--- a/libphobos/configure ++++ b/libphobos/configure +@@ -15420,14 +15420,6 @@ fi + # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to + # "yes" for targets that have 'version = AsmExternal'. + druntime_fiber_asm_external=no +- case "$target_cpu" in +- aarch64* | \ +- arm* | \ +- i[34567]86|x86_64 | \ +- powerpc) +- druntime_fiber_asm_external=yes +- ;; +- esac + if test "$druntime_fiber_asm_external" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5 + $as_echo_n "checking for library containing swapcontext... " >&6; } +diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4 +index 8dd9c7da107..b61bf528a14 100644 +--- a/libphobos/m4/druntime/libraries.m4 ++++ b/libphobos/m4/druntime/libraries.m4 +@@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT], + # Keep this in sync with core/thread.d, set druntime_fiber_asm_external to + # "yes" for targets that have 'version = AsmExternal'. + druntime_fiber_asm_external=no +- case "$target_cpu" in +- aarch64* | \ +- arm* | \ +- i[[34567]]86|x86_64 | \ +- powerpc) +- druntime_fiber_asm_external=yes +- ;; +- esac + if test "$druntime_fiber_asm_external" = no; then + AC_SEARCH_LIBS([swapcontext], [c ucontext], [], + AC_MSG_ERROR([swapcontext required but not found])) +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0033-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-x86_64/0033-libphobos-do-not-use-LFS64-symbols.patch deleted file mode 100644 index 138bd64b7..000000000 --- a/cross/gcc-x86_64/0033-libphobos-do-not-use-LFS64-symbols.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b71d21b87e6946c763edad5e420bf22d8a453077 Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 29 May 2023 15:33:11 +0000 -Subject: [PATCH 33/35] libphobos: do not use LFS64 symbols - -musl does not have these since 1.2.4, we can't use the compat interfaces. ---- - libphobos/libdruntime/core/sys/posix/config.d | 2 +- - libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- - 2 files changed, 2 insertions(+), 6 deletions(-) - -diff --git a/libphobos/libdruntime/core/sys/posix/config.d b/libphobos/libdruntime/core/sys/posix/config.d -index ae6752f220e..6b80d1ff0e6 100644 ---- a/libphobos/libdruntime/core/sys/posix/config.d -+++ b/libphobos/libdruntime/core/sys/posix/config.d -@@ -88,7 +88,7 @@ else version (CRuntime_Musl) - enum __REDIRECT = false; - - // Those three are irrelevant for Musl as it always uses 64 bits off_t -- enum __USE_FILE_OFFSET64 = _FILE_OFFSET_BITS == 64; -+ enum __USE_FILE_OFFSET64 = false; - enum __USE_LARGEFILE = __USE_FILE_OFFSET64 && !__REDIRECT; - enum __USE_LARGEFILE64 = __USE_FILE_OFFSET64 && !__REDIRECT; - -diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d -index 0d3d517d69a..323aa0af72d 100644 ---- a/libphobos/libdruntime/core/sys/posix/sys/mman.d -+++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d -@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) - } - else version (CRuntime_Musl) - { -- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); -- static if (__USE_FILE_OFFSET64) -- alias mmap = mmap64; -- else -- void* mmap(void*, size_t, int, int, int, off_t); -+ void* mmap(void*, size_t, int, int, int, off_t); - int munmap(void*, size_t); - } - else version (CRuntime_UClibc) --- -2.41.0 - diff --git a/cross/gcc-x86_64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch b/cross/gcc-x86_64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch new file mode 100644 index 000000000..38354fa65 --- /dev/null +++ b/cross/gcc-x86_64/0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch @@ -0,0 +1,25 @@ +From ab88348da140c68e5e1142041dbe1c7b7d9c9a07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Tue, 19 Jul 2022 14:54:07 +0200 +Subject: [PATCH] libgnat: time_t is always 64-bit on musl libc + +--- + gcc/ada/libgnat/s-parame.ads | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 98284a4d13e..0d14f116a10 100644 +--- a/gcc/ada/libgnat/s-parame.ads ++++ b/gcc/ada/libgnat/s-parame.ads +@@ -101,7 +101,7 @@ package System.Parameters is + -- Characteristics of time_t type -- + ------------------------------------ + +- time_t_bits : constant := Long_Integer'Size; ++ time_t_bits : constant := Long_Long_Integer'Size; + -- Number of bits in type time_t + + ---------------------------------------------- +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0034-libgo-fix-lfs64-use.patch b/cross/gcc-x86_64/0034-libgo-fix-lfs64-use.patch deleted file mode 100644 index cf47858d6..000000000 --- a/cross/gcc-x86_64/0034-libgo-fix-lfs64-use.patch +++ /dev/null @@ -1,195 +0,0 @@ -From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001 -From: psykose -Date: Mon, 10 Jul 2023 23:23:29 +0000 -Subject: [PATCH 34/35] libgo: fix lfs64 use - ---- - .../go/internal/syscall/unix/at_largefile.go | 2 +- - libgo/go/os/dir_largefile.go | 2 +- - libgo/go/syscall/libcall_glibc.go | 2 +- - libgo/go/syscall/libcall_linux.go | 4 +-- - libgo/go/syscall/libcall_posix_largefile.go | 26 +++++++++---------- - libgo/runtime/go-varargs.c | 2 +- - libgo/sysinfo.c | 9 +++---- - 7 files changed, 22 insertions(+), 25 deletions(-) - -diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go -index 82e0dcfd074..16151ecad1b 100644 ---- a/libgo/go/internal/syscall/unix/at_largefile.go -+++ b/libgo/go/internal/syscall/unix/at_largefile.go -@@ -10,5 +10,5 @@ import ( - "syscall" - ) - --//extern fstatat64 -+//extern fstatat - func fstatat(int32, *byte, *syscall.Stat_t, int32) int32 -diff --git a/libgo/go/os/dir_largefile.go b/libgo/go/os/dir_largefile.go -index 1fc5ee0771f..0c6dffe1a75 100644 ---- a/libgo/go/os/dir_largefile.go -+++ b/libgo/go/os/dir_largefile.go -@@ -11,5 +11,5 @@ package os - - import "syscall" - --//extern readdir64 -+//extern readdir - func libc_readdir(*syscall.DIR) *syscall.Dirent -diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go -index 5c1ec483c75..5a1245ed44b 100644 ---- a/libgo/go/syscall/libcall_glibc.go -+++ b/libgo/go/syscall/libcall_glibc.go -@@ -114,7 +114,7 @@ func Pipe2(p []int, flags int) (err error) { - } - - //sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error) --//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t -+//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t - - func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - if race.Enabled { -diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go -index 03ca7261b59..ad21fd0b3ac 100644 ---- a/libgo/go/syscall/libcall_linux.go -+++ b/libgo/go/syscall/libcall_linux.go -@@ -158,7 +158,7 @@ func Reboot(cmd int) (err error) { - //adjtimex(buf *Timex) _C_int - - //sys Fstatfs(fd int, buf *Statfs_t) (err error) --//fstatfs64(fd _C_int, buf *Statfs_t) _C_int -+//fstatfs(fd _C_int, buf *Statfs_t) _C_int - - func Gettid() (tid int) { - r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0) -@@ -245,7 +245,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i - } - - //sys Statfs(path string, buf *Statfs_t) (err error) --//statfs64(path *byte, buf *Statfs_t) _C_int -+//statfs(path *byte, buf *Statfs_t) _C_int - - //sysnb Sysinfo(info *Sysinfo_t) (err error) - //sysinfo(info *Sysinfo_t) _C_int -diff --git a/libgo/go/syscall/libcall_posix_largefile.go b/libgo/go/syscall/libcall_posix_largefile.go -index f90055bb29a..334212f0af1 100644 ---- a/libgo/go/syscall/libcall_posix_largefile.go -+++ b/libgo/go/syscall/libcall_posix_largefile.go -@@ -10,40 +10,40 @@ - package syscall - - //sys Creat(path string, mode uint32) (fd int, err error) --//creat64(path *byte, mode Mode_t) _C_int -+//creat(path *byte, mode Mode_t) _C_int - - //sys Fstat(fd int, stat *Stat_t) (err error) --//fstat64(fd _C_int, stat *Stat_t) _C_int -+//fstat(fd _C_int, stat *Stat_t) _C_int - - //sys Ftruncate(fd int, length int64) (err error) --//ftruncate64(fd _C_int, length Offset_t) _C_int -+//ftruncate(fd _C_int, length Offset_t) _C_int - - //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) --//getrlimit64(resource _C_int, rlim *Rlimit) _C_int -+//getrlimit(resource _C_int, rlim *Rlimit) _C_int - - //sys Lstat(path string, stat *Stat_t) (err error) --//lstat64(path *byte, stat *Stat_t) _C_int -+//lstat(path *byte, stat *Stat_t) _C_int - - //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) --//mmap64(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte -+//mmap(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte - - //sys Open(path string, mode int, perm uint32) (fd int, err error) --//__go_open64(path *byte, mode _C_int, perm Mode_t) _C_int -+//__go_open(path *byte, mode _C_int, perm Mode_t) _C_int - - //sys Pread(fd int, p []byte, offset int64) (n int, err error) --//pread64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t -+//pread(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t - - //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) --//pwrite64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t -+//pwrite(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t - - //sys Seek(fd int, offset int64, whence int) (off int64, err error) --//lseek64(fd _C_int, offset Offset_t, whence _C_int) Offset_t -+//lseek(fd _C_int, offset Offset_t, whence _C_int) Offset_t - - //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) --//setrlimit64(resource int, rlim *Rlimit) _C_int -+//setrlimit(resource int, rlim *Rlimit) _C_int - - //sys Stat(path string, stat *Stat_t) (err error) --//stat64(path *byte, stat *Stat_t) _C_int -+//stat(path *byte, stat *Stat_t) _C_int - - //sys Truncate(path string, length int64) (err error) --//truncate64(path *byte, length Offset_t) _C_int -+//truncate(path *byte, length Offset_t) _C_int -diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c -index f84860891e6..7efc9615985 100644 ---- a/libgo/runtime/go-varargs.c -+++ b/libgo/runtime/go-varargs.c -@@ -84,7 +84,7 @@ __go_ioctl_ptr (int d, int request, void *arg) - int - __go_open64 (char *path, int mode, mode_t perm) - { -- return open64 (path, mode, perm); -+ return open (path, mode, perm); - } - - #endif -diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c -index 180f5c31d74..1d717d55c0e 100644 ---- a/libgo/sysinfo.c -+++ b/libgo/sysinfo.c -@@ -366,7 +366,7 @@ typedef loff_t libgo_loff_t_type; - #endif - - #if defined(HAVE_OFF64_T) --typedef off64_t libgo_off_t_type; -+typedef off_t libgo_off_t_type; - #else - typedef off_t libgo_off_t_type; - #endif -@@ -398,13 +398,11 @@ typedef off_t libgo_off_t_type; - - // From dirent.h - SREF(dirent); --SREF(dirent64); - OTREF(DIR); - EREF(DT_UNKNOWN); - - // From fcntl.h - SREF(flock); --SREF(flock64); - - // From ffi headers - SREF(_ffi_type); -@@ -485,11 +483,10 @@ EREF(SS_ONSTACK); - EREF(SEGV_MAPERR); - - // From stat.h --SREF(stat64); -+SREF(stat); - - // From statfs.h - SREF(statfs); --SREF(statfs64); - - // From sysinfo.h - SREF(sysinfo); -@@ -519,7 +516,7 @@ EREF(PTRACE_PEEKTEXT); - - // From sys/resource.h - SREF(rusage); --SREF(rlimit64); -+SREF(rlimit); - EREF(RLIMIT_NOFILE); - EREF(PRIO_USER); - EREF(RUSAGE_SELF); --- -2.41.0 - diff --git a/cross/gcc-x86_64/0035-libphobos-do-not-use-LFS64-symbols.patch b/cross/gcc-x86_64/0035-libphobos-do-not-use-LFS64-symbols.patch new file mode 100644 index 000000000..692f764f6 --- /dev/null +++ b/cross/gcc-x86_64/0035-libphobos-do-not-use-LFS64-symbols.patch @@ -0,0 +1,30 @@ +From f865fb0a27252bd3a01fc4596f101d389929311c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 29 May 2023 15:33:11 +0000 +Subject: [PATCH] libphobos: do not use LFS64 symbols + +musl does not have these since 1.2.4, we can't use the compat interfaces. +--- + libphobos/libdruntime/core/sys/posix/sys/mman.d | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d +index b1eb9fa8107..3aee0d96319 100644 +--- a/libphobos/libdruntime/core/sys/posix/sys/mman.d ++++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d +@@ -293,11 +293,7 @@ else version (CRuntime_Bionic) + } + else version (CRuntime_Musl) + { +- static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t); +- static if (__USE_FILE_OFFSET64) +- alias mmap = mmap64; +- else +- void* mmap(void*, size_t, int, int, int, off_t); ++ void* mmap(void*, size_t, int, int, int, off_t); + int munmap(void*, size_t); + } + else version (CRuntime_UClibc) +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0035-loongarch-disable-multilib-support.patch b/cross/gcc-x86_64/0035-loongarch-disable-multilib-support.patch deleted file mode 100644 index acfc47c7f..000000000 --- a/cross/gcc-x86_64/0035-loongarch-disable-multilib-support.patch +++ /dev/null @@ -1,32 +0,0 @@ -From c4f484f465a32e796ae384aa3f90e79fa218b4e9 Mon Sep 17 00:00:00 2001 -From: Jingyun Hua -Date: Mon, 7 Aug 2023 15:25:58 +0800 -Subject: [PATCH] loongarch disable multilib support - -Signed-off-by: Jingyun Hua ---- - gcc/config/loongarch/t-linux | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux -index 23e1fb979..c2753abb8 100644 ---- a/gcc/config/loongarch/t-linux -+++ b/gcc/config/loongarch/t-linux -@@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) - MULTIOSDIR_lp64s := ../lib64/sf$(call if_multiarch,:loongarch64-linux-gnusf) - - # Don't define MULTILIB_OSDIRNAMES if multilib is disabled. --ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),) -- -- MULTILIB_OSDIRNAMES = .=$(MULTIOSDIR_$(mlib_default)) -- MULTILIB_OSDIRNAMES += mabi.lp64d=$(MULTIOSDIR_lp64d) -- MULTILIB_OSDIRNAMES += mabi.lp64f=$(MULTIOSDIR_lp64f) -- MULTILIB_OSDIRNAMES += mabi.lp64s=$(MULTIOSDIR_lp64s) -- --endif -+ MULTILIB_OSDIRNAMES = mabi.lp64d=../lib -+ MULTILIB_OSDIRNAMES += mabi.lp64f=../lib -+ MULTILIB_OSDIRNAMES += mabi.lp64s=../lib --- -2.41.0 - diff --git a/cross/gcc-x86_64/0036-libgo-fix-lfs64-use.patch b/cross/gcc-x86_64/0036-libgo-fix-lfs64-use.patch new file mode 100644 index 000000000..355edd642 --- /dev/null +++ b/cross/gcc-x86_64/0036-libgo-fix-lfs64-use.patch @@ -0,0 +1,195 @@ +From cf6ba089ba26cd970962e874a3e35f020c3e921c Mon Sep 17 00:00:00 2001 +From: psykose +Date: Mon, 10 Jul 2023 23:23:29 +0000 +Subject: [PATCH] libgo: fix lfs64 use + +--- + .../go/internal/syscall/unix/at_largefile.go | 2 +- + libgo/go/os/dir_largefile.go | 2 +- + libgo/go/syscall/libcall_glibc.go | 2 +- + libgo/go/syscall/libcall_linux.go | 4 +-- + libgo/go/syscall/libcall_posix_largefile.go | 26 +++++++++---------- + libgo/runtime/go-varargs.c | 2 +- + libgo/sysinfo.c | 9 +++---- + 7 files changed, 22 insertions(+), 25 deletions(-) + +diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go +index 82e0dcfd074..16151ecad1b 100644 +--- a/libgo/go/internal/syscall/unix/at_largefile.go ++++ b/libgo/go/internal/syscall/unix/at_largefile.go +@@ -10,5 +10,5 @@ import ( + "syscall" + ) + +-//extern fstatat64 ++//extern fstatat + func fstatat(int32, *byte, *syscall.Stat_t, int32) int32 +diff --git a/libgo/go/os/dir_largefile.go b/libgo/go/os/dir_largefile.go +index 1fc5ee0771f..0c6dffe1a75 100644 +--- a/libgo/go/os/dir_largefile.go ++++ b/libgo/go/os/dir_largefile.go +@@ -11,5 +11,5 @@ package os + + import "syscall" + +-//extern readdir64 ++//extern readdir + func libc_readdir(*syscall.DIR) *syscall.Dirent +diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go +index 5c1ec483c75..5a1245ed44b 100644 +--- a/libgo/go/syscall/libcall_glibc.go ++++ b/libgo/go/syscall/libcall_glibc.go +@@ -114,7 +114,7 @@ func Pipe2(p []int, flags int) (err error) { + } + + //sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error) +-//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t ++//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t + + func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if race.Enabled { +diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go +index 03ca7261b59..ad21fd0b3ac 100644 +--- a/libgo/go/syscall/libcall_linux.go ++++ b/libgo/go/syscall/libcall_linux.go +@@ -158,7 +158,7 @@ func Reboot(cmd int) (err error) { + //adjtimex(buf *Timex) _C_int + + //sys Fstatfs(fd int, buf *Statfs_t) (err error) +-//fstatfs64(fd _C_int, buf *Statfs_t) _C_int ++//fstatfs(fd _C_int, buf *Statfs_t) _C_int + + func Gettid() (tid int) { + r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0) +@@ -245,7 +245,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i + } + + //sys Statfs(path string, buf *Statfs_t) (err error) +-//statfs64(path *byte, buf *Statfs_t) _C_int ++//statfs(path *byte, buf *Statfs_t) _C_int + + //sysnb Sysinfo(info *Sysinfo_t) (err error) + //sysinfo(info *Sysinfo_t) _C_int +diff --git a/libgo/go/syscall/libcall_posix_largefile.go b/libgo/go/syscall/libcall_posix_largefile.go +index f90055bb29a..334212f0af1 100644 +--- a/libgo/go/syscall/libcall_posix_largefile.go ++++ b/libgo/go/syscall/libcall_posix_largefile.go +@@ -10,40 +10,40 @@ + package syscall + + //sys Creat(path string, mode uint32) (fd int, err error) +-//creat64(path *byte, mode Mode_t) _C_int ++//creat(path *byte, mode Mode_t) _C_int + + //sys Fstat(fd int, stat *Stat_t) (err error) +-//fstat64(fd _C_int, stat *Stat_t) _C_int ++//fstat(fd _C_int, stat *Stat_t) _C_int + + //sys Ftruncate(fd int, length int64) (err error) +-//ftruncate64(fd _C_int, length Offset_t) _C_int ++//ftruncate(fd _C_int, length Offset_t) _C_int + + //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) +-//getrlimit64(resource _C_int, rlim *Rlimit) _C_int ++//getrlimit(resource _C_int, rlim *Rlimit) _C_int + + //sys Lstat(path string, stat *Stat_t) (err error) +-//lstat64(path *byte, stat *Stat_t) _C_int ++//lstat(path *byte, stat *Stat_t) _C_int + + //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) +-//mmap64(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte ++//mmap(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte + + //sys Open(path string, mode int, perm uint32) (fd int, err error) +-//__go_open64(path *byte, mode _C_int, perm Mode_t) _C_int ++//__go_open(path *byte, mode _C_int, perm Mode_t) _C_int + + //sys Pread(fd int, p []byte, offset int64) (n int, err error) +-//pread64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t ++//pread(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t + + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +-//pwrite64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t ++//pwrite(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t + + //sys Seek(fd int, offset int64, whence int) (off int64, err error) +-//lseek64(fd _C_int, offset Offset_t, whence _C_int) Offset_t ++//lseek(fd _C_int, offset Offset_t, whence _C_int) Offset_t + + //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) +-//setrlimit64(resource int, rlim *Rlimit) _C_int ++//setrlimit(resource int, rlim *Rlimit) _C_int + + //sys Stat(path string, stat *Stat_t) (err error) +-//stat64(path *byte, stat *Stat_t) _C_int ++//stat(path *byte, stat *Stat_t) _C_int + + //sys Truncate(path string, length int64) (err error) +-//truncate64(path *byte, length Offset_t) _C_int ++//truncate(path *byte, length Offset_t) _C_int +diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c +index f84860891e6..7efc9615985 100644 +--- a/libgo/runtime/go-varargs.c ++++ b/libgo/runtime/go-varargs.c +@@ -84,7 +84,7 @@ __go_ioctl_ptr (int d, int request, void *arg) + int + __go_open64 (char *path, int mode, mode_t perm) + { +- return open64 (path, mode, perm); ++ return open (path, mode, perm); + } + + #endif +diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c +index 180f5c31d74..1d717d55c0e 100644 +--- a/libgo/sysinfo.c ++++ b/libgo/sysinfo.c +@@ -366,7 +366,7 @@ typedef loff_t libgo_loff_t_type; + #endif + + #if defined(HAVE_OFF64_T) +-typedef off64_t libgo_off_t_type; ++typedef off_t libgo_off_t_type; + #else + typedef off_t libgo_off_t_type; + #endif +@@ -398,13 +398,11 @@ typedef off_t libgo_off_t_type; + + // From dirent.h + SREF(dirent); +-SREF(dirent64); + OTREF(DIR); + EREF(DT_UNKNOWN); + + // From fcntl.h + SREF(flock); +-SREF(flock64); + + // From ffi headers + SREF(_ffi_type); +@@ -485,11 +483,10 @@ EREF(SS_ONSTACK); + EREF(SEGV_MAPERR); + + // From stat.h +-SREF(stat64); ++SREF(stat); + + // From statfs.h + SREF(statfs); +-SREF(statfs64); + + // From sysinfo.h + SREF(sysinfo); +@@ -519,7 +516,7 @@ EREF(PTRACE_PEEKTEXT); + + // From sys/resource.h + SREF(rusage); +-SREF(rlimit64); ++SREF(rlimit); + EREF(RLIMIT_NOFILE); + EREF(PRIO_USER); + EREF(RUSAGE_SELF); +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0036-libphobos-add-riscv64-and-loongarch64-support.patch b/cross/gcc-x86_64/0036-libphobos-add-riscv64-and-loongarch64-support.patch deleted file mode 100644 index ba8377b1d..000000000 --- a/cross/gcc-x86_64/0036-libphobos-add-riscv64-and-loongarch64-support.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Celeste -Date: Mon, 2 Sep 2024 02:54:17 +0000 -Subject: [PATCH] libphobos: add riscv64 and loongarch64 support - -Add musl support for these 2 architectures based on fenv.h and signal.h from: - -https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits?h=v1.2.5 - -https://git.musl-libc.org/cgit/musl/tree/arch/loongarch64/bits?h=v1.2.5 ---- - libphobos/libdruntime/core/stdc/fenv.d | 13 +++++++++++++ - libphobos/libdruntime/core/sys/posix/signal.d | 10 ++++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d -index a7364c0a..5b327e4a 100644 ---- a/libphobos/libdruntime/core/stdc/fenv.d -+++ b/libphobos/libdruntime/core/stdc/fenv.d -@@ -436,20 +436,33 @@ else version (CRuntime_Musl) - ushort __cs_selector; - ushort __opcode; - uint __data_offset; - ushort __data_selector; - ushort __unused5; - version (X86_64) - uint __mxcsr; - } - alias ushort fexcept_t; - } -+ else version (RISCV64) -+ { -+ alias uint fenv_t; -+ alias uint fexcept_t; -+ } -+ else version (LoongArch64) -+ { -+ struct fenv_t -+ { -+ uint __cw; -+ } -+ alias uint fexcept_t; -+ } - else - { - static assert(false, "Architecture not supported."); - } - } - else version (CRuntime_Newlib) - { - version (AArch64) - { - alias fenv_t = ulong; -diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d -index a8b7f751..78d8b3cd 100644 ---- a/libphobos/libdruntime/core/sys/posix/signal.d -+++ b/libphobos/libdruntime/core/sys/posix/signal.d -@@ -2751,20 +2751,30 @@ else version (CRuntime_Musl) - else version (PPC_Any) - { - enum MINSIGSTKSZ = 4096; - enum SIGSTKSZ = 10240; - } - else version (X86_Any) - { - enum MINSIGSTKSZ = 2048; - enum SIGSTKSZ = 8192; - } -+ else version (RISCV64) -+ { -+ enum MINSIGSTKSZ = 2048; -+ enum SIGSTKSZ = 8192; -+ } -+ else version (LoongArch64) -+ { -+ enum MINSIGSTKSZ = 4096; -+ enum SIGSTKSZ = 16384; -+ } - else - static assert(0, "unimplemented"); - - //ucontext_t (defined in core.sys.posix.ucontext) - //mcontext_t (defined in core.sys.posix.ucontext) - - version (MIPS_Any) - { - struct stack_t - { diff --git a/cross/gcc-x86_64/0037-loongarch-disable-multilib-support.patch b/cross/gcc-x86_64/0037-loongarch-disable-multilib-support.patch new file mode 100644 index 000000000..da7e8b34d --- /dev/null +++ b/cross/gcc-x86_64/0037-loongarch-disable-multilib-support.patch @@ -0,0 +1,32 @@ +From a809e7b909e16fcf3379571417d33574e9c1dbff Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Mon, 7 Aug 2023 15:25:58 +0800 +Subject: [PATCH] loongarch disable multilib support + +Signed-off-by: Jingyun Hua +--- + gcc/config/loongarch/t-linux | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux +index 45862048abf..73155acd832 100644 +--- a/gcc/config/loongarch/t-linux ++++ b/gcc/config/loongarch/t-linux +@@ -21,11 +21,6 @@ MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) + MULTIOSDIR_lp64s := ../lib64/sf$(call if_multiarch,:loongarch64-linux-gnusf) + + # Don't define MULTILIB_OSDIRNAMES if multilib is disabled. +-ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),) +- +- MULTILIB_OSDIRNAMES = .=$(MULTIOSDIR_$(mlib_default)) +- MULTILIB_OSDIRNAMES += mabi.lp64d=$(MULTIOSDIR_lp64d) +- MULTILIB_OSDIRNAMES += mabi.lp64f=$(MULTIOSDIR_lp64f) +- MULTILIB_OSDIRNAMES += mabi.lp64s=$(MULTIOSDIR_lp64s) +- +-endif ++ MULTILIB_OSDIRNAMES = mabi.lp64d=../lib ++ MULTILIB_OSDIRNAMES += mabi.lp64f=../lib ++ MULTILIB_OSDIRNAMES += mabi.lp64s=../lib +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0037-static-pie.patch b/cross/gcc-x86_64/0037-static-pie.patch deleted file mode 100644 index a31c20e7e..000000000 --- a/cross/gcc-x86_64/0037-static-pie.patch +++ /dev/null @@ -1,101 +0,0 @@ -Patch-Source: https://github.com/richfelker/musl-cross-make/blob/6f3701d08137496d5aac479e3a3977b5ae993c1f/patches/gcc-14.2.0/0004-static-pie.diff - -gcc doesn't enable static-pie for all arches. As of this writing arm -32-bit is missing. musl supports static-pie on all arches so this -should be allowed on all arches. - -Without this patch binaries with (only) -static-pie are broken on some -arches. - -diff --git a/gcc/common.opt b/gcc/common.opt -index a75b44ee47e..7c564818b49 100644 ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -3473,11 +3473,11 @@ Driver - - no-pie - Driver RejectNegative Negative(shared) --Don't create a dynamically linked position independent executable. -+Don't create a position independent executable. - - pie - Driver RejectNegative Negative(no-pie) --Create a dynamically linked position independent executable. -+Create a position independent executable. - - static-pie - Driver RejectNegative Negative(pie) -diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h -index 5ebbf42a13d..bb907d8e89a 100644 ---- a/gcc/config/gnu-user.h -+++ b/gcc/config/gnu-user.h -@@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define GNU_USER_TARGET_STARTFILE_SPEC \ - "%{shared:; \ - pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \ -- static:crt1.o%s; \ -- static-pie:rcrt1.o%s; \ -+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ - " PIE_SPEC ":Scrt1.o%s; \ - :crt1.o%s} " \ - GNU_USER_TARGET_CRTI " \ -- %{static:crtbeginT.o%s; \ -- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ -+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \ -+ static:crtbeginT.o%s; \ - :crtbegin.o%s} \ - %{fvtable-verify=none:%s; \ - fvtable-verify=preinit:vtv_start_preinit.o%s; \ -@@ -73,11 +72,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - GNU userspace "finalizer" file, `crtn.o'. */ - - #define GNU_USER_TARGET_ENDFILE_SPEC \ -- "%{!static:%{fvtable-verify=none:%s; \ -+ "%{static|static-pie:; \ -+ fvtable-verify=none:%s; \ - fvtable-verify=preinit:vtv_end_preinit.o%s; \ -- fvtable-verify=std:vtv_end.o%s}} \ -- %{static:crtend.o%s; \ -- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ -+ fvtable-verify=std:vtv_end.o%s} \ -+ %{shared|" PIE_SPEC ":crtendS.o%s; \ - :crtend.o%s} " \ - GNU_USER_TARGET_CRTN " " \ - CRTOFFLOADEND -@@ -106,7 +105,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC - - #if defined(HAVE_LD_EH_FRAME_HDR) --#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " -+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " - #endif - - #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ -diff --git a/gcc/gcc.cc b/gcc/gcc.cc -index 3c81c5798d8..cd96eac5d12 100644 ---- a/gcc/gcc.cc -+++ b/gcc/gcc.cc -@@ -1010,7 +1010,7 @@ proper position among the other output files. */ - #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC - #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" - #else --#define PIE_SPEC "pie" -+#define PIE_SPEC "pie|static-pie" - #define FPIE1_SPEC "fpie" - #define NO_FPIE1_SPEC FPIE1_SPEC ":;" - #define FPIE2_SPEC "fPIE" -@@ -1034,12 +1034,12 @@ proper position among the other output files. */ - #ifndef LINK_PIE_SPEC - #ifdef HAVE_LD_PIE - #ifndef LD_PIE_SPEC --#define LD_PIE_SPEC "-pie" -+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic %{static-pie:-static}}" - #endif - #else - #define LD_PIE_SPEC "" - #endif --#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " -+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " - #endif - - #ifndef LINK_BUILDID_SPEC diff --git a/cross/gcc-x86_64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-x86_64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch deleted file mode 100644 index b55477e53..000000000 --- a/cross/gcc-x86_64/0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 49926c2c657dd867f7329df6e250913fd1425475 Mon Sep 17 00:00:00 2001 -From: Andrew Pinski -Date: Fri, 28 Mar 2025 17:25:56 -0700 -Subject: [PATCH] except: Don't use the cached value of the gcc_except_table - section for comdat functions [PR119507] - -This has been broken since GCC started to put the comdat functions' gcc_except_table into their -own section; r0-118218-g3e6011cfebedfb. What would happen is after a non-comdat function is processed, -the cached value would always be used even for comdat function. Instead we should create a new -section for comdat functions. - -OK? Bootstrapped and tested on x86_64-linux-gnu. - - PR middle-end/119507 - -gcc/ChangeLog: - - * except.cc (switch_to_exception_section): Don't use the cached section if - the current function is in comdat. - -gcc/testsuite/ChangeLog: - - * g++.dg/eh/pr119507.C: New test. - -Signed-off-by: Andrew Pinski ---- - gcc/except.cc | 9 ++++++++- - gcc/testsuite/g++.dg/eh/pr119507.C | 17 +++++++++++++++++ - 2 files changed, 25 insertions(+), 1 deletion(-) - create mode 100644 gcc/testsuite/g++.dg/eh/pr119507.C - -diff --git a/gcc/except.cc b/gcc/except.cc -index 205811c6567..0fe1e093489 100644 ---- a/gcc/except.cc -+++ b/gcc/except.cc -@@ -2949,7 +2949,14 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname)) - { - section *s; - -- if (exception_section) -+ if (exception_section -+ /* Don't use the cached section for comdat if it will be different. */ -+#ifdef HAVE_LD_EH_GC_SECTIONS -+ && !(targetm_common.have_named_sections -+ && DECL_COMDAT_GROUP (current_function_decl) -+ && HAVE_COMDAT_GROUP) -+#endif -+ ) - s = exception_section; - else - { -diff --git a/gcc/testsuite/g++.dg/eh/pr119507.C b/gcc/testsuite/g++.dg/eh/pr119507.C -new file mode 100644 -index 00000000000..50afa75a43f ---- /dev/null -+++ b/gcc/testsuite/g++.dg/eh/pr119507.C -@@ -0,0 +1,17 @@ -+// { dg-do compile { target comdat_group } } -+// Force off function sections -+// Force on exceptions -+// { dg-options "-fno-function-sections -fexceptions" } -+// PR middle-end/119507 -+ -+ -+inline int comdat() { try { throw 1; } catch (int) { return 1; } return 0; } -+int another_func_with_exception() { try { throw 1; } catch (int) { return 1; } return 0; } -+inline int comdat1() { try { throw 1; } catch (int) { return 1; } return 0; } -+int foo() { return comdat() + comdat1(); } -+ -+// Make sure the gcc puts the exception table for both comdat and comdat1 in their own section -+// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z6comdatv" 1 } } -+// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z7comdat1v" 1 } } -+// There should be 3 exception tables, -+// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } --- -2.49.0 - diff --git a/cross/gcc-x86_64/0038-static-PIE-ensure-static-reaches-the-linker.patch b/cross/gcc-x86_64/0038-static-PIE-ensure-static-reaches-the-linker.patch new file mode 100644 index 000000000..bd870a370 --- /dev/null +++ b/cross/gcc-x86_64/0038-static-PIE-ensure-static-reaches-the-linker.patch @@ -0,0 +1,113 @@ +From 72606254a2456763cb252b4d729a9505e77e449d Mon Sep 17 00:00:00 2001 +From: Rich Felker +Date: Fri, 25 Jul 2025 02:41:46 -0700 +Subject: [PATCH] static PIE: ensure -static reaches the linker + +on some targets, the logic for the compiler option -static seems not +to be processed when -pie is present. rather than playing +whack-a-mole, just ensure LD_PIE_SPEC specs always pass -static to ld +if either -static or -static-pie is present on the compiler driver +command line. + +this may produce redundant -static arguments but it doesn't matter. +--- + gcc/common.opt | 4 ++-- + gcc/config/gnu-user.h | 17 ++++++++--------- + gcc/gcc.cc | 6 +++--- + 3 files changed, 13 insertions(+), 14 deletions(-) + +diff --git a/gcc/common.opt b/gcc/common.opt +index e65a575d9f8..7ad38711f6e 100644 +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -3968,11 +3968,11 @@ Driver + + no-pie + Driver RejectNegative Negative(shared) +-Don't create a dynamically linked position independent executable. ++Don't create a position independent executable. + + pie + Driver RejectNegative Negative(no-pie) +-Create a dynamically linked position independent executable. ++Create a position independent executable. + + static-pie + Driver RejectNegative Negative(pie) +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index 0426efdb8c3..866c8bd77f2 100644 +--- a/gcc/config/gnu-user.h ++++ b/gcc/config/gnu-user.h +@@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define GNU_USER_TARGET_STARTFILE_SPEC \ + "%{shared:; \ + pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \ +- static:crt1.o%s; \ +- static-pie:rcrt1.o%s; \ ++ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ + " PIE_SPEC ":Scrt1.o%s; \ + :crt1.o%s} " \ + GNU_USER_TARGET_CRTI " \ +- %{static:crtbeginT.o%s; \ +- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ ++ %{shared|" PIE_SPEC ":crtbeginS.o%s; \ ++ static:crtbeginT.o%s; \ + :crtbegin.o%s} \ + %{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_start_preinit.o%s; \ +@@ -73,11 +72,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + GNU userspace "finalizer" file, `crtn.o'. */ + + #define GNU_USER_TARGET_ENDFILE_SPEC \ +- "%{!static:%{fvtable-verify=none:%s; \ ++ "%{static|static-pie:; \ ++ fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ +- fvtable-verify=std:vtv_end.o%s}} \ +- %{static:crtend.o%s; \ +- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ ++ fvtable-verify=std:vtv_end.o%s} \ ++ %{shared|" PIE_SPEC ":crtendS.o%s; \ + :crtend.o%s} " \ + GNU_USER_TARGET_CRTN " " \ + CRTOFFLOADEND +@@ -106,7 +105,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " ++#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " + #endif + + #if !defined(LINK_LIBATOMIC_SPEC) && defined(ENABLE_AUTOLINK_LIBATOMIC) +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index e9f78f0f4c1..767ff65f348 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1056,7 +1056,7 @@ proper position among the other output files. */ + #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC + #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" + #else +-#define PIE_SPEC "pie" ++#define PIE_SPEC "pie|static-pie" + #define FPIE1_SPEC "fpie" + #define NO_FPIE1_SPEC FPIE1_SPEC ":;" + #define FPIE2_SPEC "fPIE" +@@ -1080,12 +1080,12 @@ proper position among the other output files. */ + #ifndef LINK_PIE_SPEC + #ifdef HAVE_LD_PIE + #ifndef LD_PIE_SPEC +-#define LD_PIE_SPEC "-pie" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic -static}" + #endif + #else + #define LD_PIE_SPEC "" + #endif +-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " ++#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " + #endif + + #ifndef LINK_BUILDID_SPEC +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch b/cross/gcc-x86_64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch new file mode 100644 index 000000000..c713030bb --- /dev/null +++ b/cross/gcc-x86_64/0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch @@ -0,0 +1,77 @@ +From d984c5c9ed973bb7072b48399e5d9bb1f35c3123 Mon Sep 17 00:00:00 2001 +From: Andrew Pinski +Date: Fri, 28 Mar 2025 17:25:56 -0700 +Subject: [PATCH] except: Don't use the cached value of the gcc_except_table + section for comdat functions [PR119507] + +This has been broken since GCC started to put the comdat functions' gcc_except_table into their +own section; r0-118218-g3e6011cfebedfb. What would happen is after a non-comdat function is processed, +the cached value would always be used even for comdat function. Instead we should create a new +section for comdat functions. + +OK? Bootstrapped and tested on x86_64-linux-gnu. + + PR middle-end/119507 + +gcc/ChangeLog: + + * except.cc (switch_to_exception_section): Don't use the cached section if + the current function is in comdat. + +gcc/testsuite/ChangeLog: + + * g++.dg/eh/pr119507.C: New test. + +Signed-off-by: Andrew Pinski +--- + gcc/except.cc | 9 ++++++++- + gcc/testsuite/g++.dg/eh/pr119507.C | 17 +++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/g++.dg/eh/pr119507.C + +diff --git a/gcc/except.cc b/gcc/except.cc +index 205811c6567..0fe1e093489 100644 +--- a/gcc/except.cc ++++ b/gcc/except.cc +@@ -2949,7 +2949,14 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname)) + { + section *s; + +- if (exception_section) ++ if (exception_section ++ /* Don't use the cached section for comdat if it will be different. */ ++#ifdef HAVE_LD_EH_GC_SECTIONS ++ && !(targetm_common.have_named_sections ++ && DECL_COMDAT_GROUP (current_function_decl) ++ && HAVE_COMDAT_GROUP) ++#endif ++ ) + s = exception_section; + else + { +diff --git a/gcc/testsuite/g++.dg/eh/pr119507.C b/gcc/testsuite/g++.dg/eh/pr119507.C +new file mode 100644 +index 00000000000..50afa75a43f +--- /dev/null ++++ b/gcc/testsuite/g++.dg/eh/pr119507.C +@@ -0,0 +1,17 @@ ++// { dg-do compile { target comdat_group } } ++// Force off function sections ++// Force on exceptions ++// { dg-options "-fno-function-sections -fexceptions" } ++// PR middle-end/119507 ++ ++ ++inline int comdat() { try { throw 1; } catch (int) { return 1; } return 0; } ++int another_func_with_exception() { try { throw 1; } catch (int) { return 1; } return 0; } ++inline int comdat1() { try { throw 1; } catch (int) { return 1; } return 0; } ++int foo() { return comdat() + comdat1(); } ++ ++// Make sure the gcc puts the exception table for both comdat and comdat1 in their own section ++// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z6comdatv" 1 } } ++// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table._Z7comdat1v" 1 } } ++// There should be 3 exception tables, ++// { dg-final { scan-assembler-times ".section\[\t \]\[^\n\]*.gcc_except_table" 3 } } +-- +2.50.1 + diff --git a/cross/gcc-x86_64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch b/cross/gcc-x86_64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch new file mode 100644 index 000000000..a25266014 --- /dev/null +++ b/cross/gcc-x86_64/0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch @@ -0,0 +1,164 @@ +From 57eb290b3c8fc36da99213f5050b46cd93575234 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Sat, 26 Jul 2025 02:59:45 -0700 +Subject: [PATCH] ada: libgnat: use stub symbolic module name functions + +The "linux" implementation depends on glibc internals and accordingly +does not work on musl. + +Signed-off-by: Ariadne Conill +--- + gcc/ada/Makefile.rtl | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index cb41e6887cd..152ba70db4d 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1642,7 +1642,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb +Date: Sat, 26 Jul 2025 03:02:38 -0700 +Subject: [PATCH] ada: libgnat: recognize linux-musleabi and linux-muslgnueabi + platforms for ARM + +--- + gcc/ada/Makefile.rtl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 152ba70db4d..89574cdfba7 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2500,7 +2500,7 @@ endif + + # ARM linux, GNU eabi + ifeq ($(SELECTED_PAIRS),PAIRS_NONE) +-ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),) ++ifeq ($(strip $(filter-out arm% linux-gnueabi% linux-musleabi% linux-muslgnueabi%,$(target_cpu) $(target_os))),) + + SELECTED_PAIRS=arm-linux-gnueabi + +-- +2.50.1 + diff --git a/cross/gcc-x86_64/APKBUILD b/cross/gcc-x86_64/APKBUILD index 56338ba08..7e4a5ee68 100644 --- a/cross/gcc-x86_64/APKBUILD +++ b/cross/gcc-x86_64/APKBUILD @@ -24,7 +24,7 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-x86_64 -pkgver=14.3.0 +pkgver=15.1.1_git20250719 # i.e. 13.2.1, must match gcc/BASE-VER _pkgbase="${pkgver%%_git*}" # date component from snapshots @@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-x86_64 -pkgrel=6 +pkgrel=2 pkgdesc="Stage2 cross-compiler for x86_64" url="https://gcc.gnu.org" arch="aarch64" @@ -183,7 +183,7 @@ if $_libgomp; then fi case "$CTARGET_ARCH" in -riscv64|loongarch64) +riscv64) LANG_ADA=false;; esac @@ -241,7 +241,7 @@ fi # PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches, # so that they can be properly tracked and easily rebased if needed. #source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz -source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz +source="https://gcc.gnu.org/pub/gcc/snapshots/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-specs-turn-on-Wl-z-now-by-default.patch @@ -249,37 +249,40 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch 0006-Enable-Wformat-and-Wformat-security-by-default.patch 0007-Enable-Wtrampolines-by-default.patch - 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch - 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch - 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch - 0011-libiberty-copy-PIC-objects-during-build-process.patch - 0012-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-libphobos-do-not-use-LFS64-symbols.patch - 0034-libgo-fix-lfs64-use.patch - 0035-loongarch-disable-multilib-support.patch - 0036-libphobos-add-riscv64-and-loongarch64-support.patch - 0037-static-pie.patch - 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch + 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch + 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0012-libiberty-copy-PIC-objects-during-build-process.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-ada-fix-shared-linking.patch + 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0017-add-fortify-headers-paths.patch + 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0020-aarch64-disable-multilib-support.patch + 0021-s390x-disable-multilib-support.patch + 0022-ppc64-le-disable-multilib-support.patch + 0023-x86_64-disable-multilib-support.patch + 0024-riscv-disable-multilib-support.patch + 0025-always-build-libgcc_eh.a.patch + 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch + 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch + 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch + 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch + 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch + 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch + 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch + 0033-druntime-link-against-libucontext-on-all-platforms.patch + 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch + 0035-libphobos-do-not-use-LFS64-symbols.patch + 0036-libgo-fix-lfs64-use.patch + 0037-loongarch-disable-multilib-support.patch + 0038-static-PIE-ensure-static-reaches-the-linker.patch + 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch + 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch + 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch " # secfixes: @@ -287,8 +290,8 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz # - CVE-2023-4039 # we build out-of-tree -#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap -builddir="$srcdir"/gcc-$_pkgbase +builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap +#builddir="$srcdir"/gcc-$_pkgbase _gcclibdir="usr/lib/gcc/$CTARGET/$_pkgbase" _gcclibexec="usr/libexec/gcc/$CTARGET/$_pkgbase" @@ -752,43 +755,46 @@ gdb() { } sha512sums=" -cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93 gcc-14.3.0.tar.xz -1ecffba1b07d60e1b4422302b032bbea918b674c8e12b30aa6965b544d700ce86b61e9f7b8d402c6caf59257f491a394dd0912f0948565d6eae9335ee54f3b35 0001-posix_memalign.patch -6dd1eecbc050e30e5a0493969a0e80507d971f4ca87c06466f725fa50c9106e18aef86453fc8a80cd277438b6e79695a99cdaf2eaeb2f1add7e28f7cffd0cd2f 0002-gcc-poison-system-directories.patch -b6903b60b01187bfebc961e74d01ff5d8dc2852747663dff2b4a4f66df4b5aa412347fe92926cce1821fdd0c59d088404acbbced4b464aba9664d599a9e1bbce 0003-specs-turn-on-Wl-z-now-by-default.patch -d41a519ea5014e9ab49f017d3793e2a0a82429c2b7ded2776f2df7a2d0ac02aa294e7dbe74e027fe7c844c87525d483e0eda3846cf16340eb02e934389cfd838 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e34d7bb51c4c413b1a10bafcdfd5729fb5980b0288277ef44ed4779700d443d2fd22129b3b22d401def140851263e803160d2f3ed8825b0bf4f3fb8606db77bd 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -83665b6adb0b8080245b253abe3344ee5106ac2bc248aad9bef713b22b644a268d75c75fbab7554e0543836903a89bc4f0bec4b6d6d4e3d5ba355dddbc5ba190 0006-Enable-Wformat-and-Wformat-security-by-default.patch -ca5757a32f02bb24bc5b42bb03dca49fb9f9e6f34776343f1c5580efd2bcacf8c5b59f4b61652fa3ea1506eb14bcd390f5fda7b4cbfd32f7d1a750d14add4739 0007-Enable-Wtrampolines-by-default.patch -e476da4c2f29a941b7f4f1dfc9a37ba82b439badc47fc3fb72630ec5620f64849bdb66d339e0182674a0ee898a75564ffaf702986b770bfd793e7fbdcaa9f21b 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -93d03afd83dee5f7129c36a7b81fa8fd323476507e2f53a4fbe40a026037e7dfafa23591145d7af5848d9a322d212497947a0f58ef828734552e6a6dabd00cfa 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -da9eaf2f0ddbec5ee14dc26053936587e6c76fbf16846db804a18cf4d318579426ebcc566aed02daf8e34f60c08b61f5d3959305886dca9bbcdc84db057258d9 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -35b9aafe7eee8138cb7aad7164a8f77c15ccdce26843cee78b5871ef91d76cad22ed0871b20f51c4b89b71afd9cfe4ba4227086e158c466558513708fe7d2a1a 0011-libiberty-copy-PIC-objects-during-build-process.patch -b40b6cbc3725ae88c506bc39a8ba10cfcdcc208fa26d667393bbb80e24346da2ccfac3ff914bb9fc4c374f022fa7f913e6873b9a66a96b79a1ac84959c9d5348 0012-libgcc_s.patch -6cc2c00b15d259289fa9831b60b58f8afdf09858410bd08ab3d839a45c6f3fb9e8e214dab851d105c61df7965f1c10255c84b5b6301630a390b27b8929a25e1e 0013-nopie.patch -0b50ad15115192699efa9fda3d4fb1c2fa95da06d7880ba34615b40c19a8256e1fe364da39f5c70dc22fbccf21db2de5900932afef68948722eeb25e435262f8 0014-ada-fix-shared-linking.patch -7640e71cd957066e2e07ffcec1f8540cd6b1bdaf976c980693bf6f5d3afaf51ca7e41c62f92cb13c86c2dea9eb9cd799b2e3ea77d74926e82bf1e12bb7a4d64e 0015-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -7f0bc42b93a389b614054e700b851abfbc53db391aa10cbdf6990d41396b293af78980bb39f1cf0967184d3fbf3d46ac7c7f096717b8f193ea34cbf7f37d7e91 0016-add-fortify-headers-paths.patch -8a8c9dc96f300f660f1a643c800352383f32db258dfcfa88a44159a38bb81a7298089a5dcb23906002c85cafc806caf6f3db0e1cb26fcac6192ae1e41d9ada3a 0017-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -6c1cbfcf9e6f54b2173af39bbbfd97e7c18ae32a690fb4c6b1e35fa183992ea0f8046d479be57b6ac7d798bf2a6dade4f9ea3e3a839dc6fb8d47203de9c89e25 0018-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -2213e07bab6f5d8d3d39c732f5385f46cc8f0c84e35054139fdaf13051252d7bf11f647f54aa8456b532166b008fff0656d8f41278e34ba868dd6fe427427a3a 0019-aarch64-disable-multilib-support.patch -a9567947471c3ba8a547a79c55e183974554bf823d9a97a165c966d7b3caad8789980e096e3b78452ece5de062bd9bb006af464bbf0c5a35b689eac3ee21e5c5 0020-s390x-disable-multilib-support.patch -f382eb5f7c2c60c5a23fac587c9629a3059d7be0898e97a1feaf9b9cbe1ef4693cc1177eb29333e8b7944fa17487478e73958be45d5782ccb9ef501961fb9a96 0021-ppc64-le-disable-multilib-support.patch -44ab86feb8e41e7c2b2e27accdf46194c9b80ee6a39543303dc04824f669d9fad182aabd40c9c7f6c265cf9bb71be830c257be115dc9d701d54eca3aa9ef174e 0022-x86_64-disable-multilib-support.patch -0ef65a344975b641343767e289578ba5b0fd381c7177ebe4558cb67d8b41e33e3b825478fa46852f1f40ec9119ff908cf75ee36307266aea13f39460e080b0b6 0023-riscv-disable-multilib-support.patch -55438233a217dc1ee58990413b8782b9bd560a1532c1e6c860f377072ed1bdf75d5dc2458ed33194040ec5427c30df3fa68948dcd26de90e3803d3f7b784becd 0024-always-build-libgcc_eh.a.patch -8fdbe0c8bf4ca60f458a33e59027de03d15ac91933fe46d8ca62119346d20b9bc2447c0bf22bceb63d0cf8613ab61512d9197f4e6c2224af473b63ef9f254295 0025-ada-libgnarl-compatibility-for-musl.patch -02e8358b8855fb49bbb2b3ef293cff67441c5fdf1f2fee4dcec86ef1fd4f701e899ea9c7e072d888b0f1e674d7874d3085138f3deb9845d1f2e35d4a1fe3f5ab 0026-ada-musl-support-fixes.patch -8eff7679140f9e39f1a0ac2e4a6cc7e131efa3d5a669696dd28300eb5d75ef3be62f10c1b91d8f8c8ba2cba1ff9cf121228b6fcd3adafa28389ac63698e7d5a7 0027-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch -720a4001f9a1fa4122e456077ecff8d3eb8af7c83d0a81f9da6a6cca05b23664206a82a349e34482c48bfe40e99aa5f21567613d0913f6a24f282bc84a994496 0028-configure-fix-detection-of-atomic-builtins-in-libato.patch -2044c23b23726965c0a6fd39f616cc464badd650947cb40495eeabd906a3af629878c1d28b403b8eb46b30a1a0ba39083023290d62f0c99ccf070063226e3f8f 0029-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch -458c9b121e00cec4d0dbe1d18c5e5332342eb0a3429129e5a9d9ace3247c31d85571ad9f47046c4ed3bc62e5d8a4297f48744a30424a19acbdd9aa484e3ee715 0030-gdc-unconditionally-link-libgphobos-against-libucont.patch -099103f4b0b4612ff4bd2e8721cf1593415b636bff74d4feba304bb610ced6f4951cb3ab89088111e58029a2f9bf4a5dcc91e2b2afe4dd9813d2fa6b0999a5a2 0031-druntime-link-against-libucontext-on-all-platforms.patch -21ff4d55eec48ad4a9db0cd359e760cff548f7f6b1a67759a2e87fc7e16a262d82d2f980d309a3ce5e14097665beeb5516a5f2d98869a5d28345e685c6fe689d 0032-libgnat-time_t-is-always-64-bit-on-musl-libc.patch -c474f34e6f9a4239d486a65141a133dbe8ce91427d502a57a9fd6eb403478a2b5715ba74f24c1cc0761e16eec77ba2c1ca921fb7d7bc1e040fc3703fc9559e75 0033-libphobos-do-not-use-LFS64-symbols.patch -c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1e0636e8890849a5719647bfbdf84f951d638f8f488cb718c 0034-libgo-fix-lfs64-use.patch -65df1d489e8d07a811f39e27fd29e3b2b4164fbc2c5fdc16a5142886d94a96e3fb28ccf4f20dd297ba6540ef8ea1ac3eb65a4279494639bf2f0f8376a3896cc3 0035-loongarch-disable-multilib-support.patch -06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch -8249ce989c1a76bcb5bbb1123ef88d88f220b709fe6ac804f18c905a7b31c4e68ef6f5cc2236f446feed89fa773a3aed996a6aba7618e73a000d73cb0b0753f6 0037-static-pie.patch -90b6148d47f39caf1b70416abf2a09f4ce048491f784f56bd659dbf99e2c9f6a44b244827f23977494ab4e42640c49c1dc79f43a4d69c2b31c4b1e25d54d8142 0038-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +a5e0082e492502385565479201bca3e9f5138a55d83540bff8b84a94d958c4d2afce474328656ee7d55fad910c04523c0068efe92382e68a327a65f6e641b88a gcc-15-20250719.tar.xz +fd5cebc5deb1d588583424acbc1b5a6d8d6f5b1bfa9f4bdbc082cfd406723f423d87011ee30e04ed18128a7ed8021cbfc9262becff5419125dc1afb6f407defa 0001-posix_memalign.patch +6634004cb9feea9ee0d063d6b6984d7db3b10c692b6139bb99169a4f2d74f0e10b5ca0ab31ce346ffef34b8eb9c3f536aa4d94bce1b27f8e0b8a9fc5cc4b7057 0002-gcc-poison-system-directories.patch +37e089791dbcbad73af866b662cda611dc0970d93e28251c7a9aa898db3b96446654e8b778d7866eb8550ba7f4a57cf22e8514d562bfed0c66613e65550d9c85 0003-specs-turn-on-Wl-z-now-by-default.patch +d4d5bfeb20a9fac968f37497d86d7eff4a9ac863e015dadbffae24c08236f5efde69b615d95191e2546672ce2d4b30d3627528c64a83fc64b715e8fa6fd4c372 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +b77cd1ee887fc52afee2fafd2d338f70a62c115017aa4fcb0ab9cf82b8a003794f75b7913cc153c767c351d2be8e1e7c113f893edee818217f20cad3cb6a2e66 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +af634de360e8b7aef285702815affb16da667719b786848ccdb9e4cca2a27826793f64c903a32a5d8ba1953965a5cc8999c58e2b6ce9ef36f74807e495cc9e42 0006-Enable-Wformat-and-Wformat-security-by-default.patch +21ad1cd4b7ef652ddaf6b9fb8071a87ec2fc694e8c420a79baf456347b8e1db5930a914c92a375943dda63d096c4823a2b8028d02a5b49c9bcdab5c170558004 0007-Enable-Wtrampolines-by-default.patch +dcd07ecf0daad8743a378abbcb921d4b17e528651a596454956563a3417fe9ea3b88dce7b15b9270f55ae2ea2a72efe8a7215236d0a21e2942c7c5ba0e8e2c39 0008-gcc-disable-SSP-on-ffreestanding-nostdlib-and-nodefa.patch +488bd530e209e3213f83d695fb2ac529c408e3dba9024457594cfb0d266acb079447bca184fbf136bacd1f1ec5ca3607dc4998b66630af9781ea7ee41c16236b 0009-gcc-params-set-default-ssp-buffer-size-to-4.patch +7229a3fe655e8460148e0cd4c39d7362e713d1a6215530547f346371a5e3647245123637e8b075c58c5e7e35c823d96a0b3cdbedb6c07b5095507b4499bc053a 0010-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +f7c1870bda4d418380f471b520b7cf20fde743f57415323c1a8898a815f8c7023adc3882e1d0453c5b6fcb65a27a9534fdeb297bf451453a95d90c0395e42c3b 0011-Don-t-declare-asprintf-if-defined-as-a-macro.patch +140c8165726404da0fc0ea01add2a7fa307377817968177334c520bdaabc23e8ec5d76f80337b89ff03edfd52dead7119433a03d2165e24780dc944633a9c2a3 0012-libiberty-copy-PIC-objects-during-build-process.patch +af848ef58b63a7592ad0f549be65fbe8dcd3c1e5ea9f30cfa65be02519ca9826d7612131c3b0042615b7537683d74eeb6849aba61810b0d8ed1c79f968188260 0013-libgcc_s.patch +c97b473c08b46090b48764af55b244ec70a13d26f2d881c57761abbc4a1c481da9766f33e59daee7188bc06c4631e53becbaf8801d0b35ca0b5fe84cb6a840f7 0014-nopie.patch +9c37cc38bb7238058751d3ff60712acd4134aa4c28d946c453b8b230bd6ba34c45c47a4b4d7e74aa7e3ed8dfc74cbb1d5a328bda706dd3037320e02a15421b86 0015-ada-fix-shared-linking.patch +b4afb30431ecdfd86acfd66ba857c275628b55e91cc9b21c18ca0e795b2fadfe895da801978a8e818ff9c93144075e72cf0521f3bce5c6c1d44e47e1b77b8ba4 0016-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +6260341ed13926ce449cf351ada85d8e28fc7da63a4ae73b69c24fb2e8d0e3003ffacb1bb0f957185b8d5d7e013f777f7f696c9a1c94b2204a9b3e8274ec2f43 0017-add-fortify-headers-paths.patch +8fe954daf7e9b1d221f0536f54186bc1715e23cf3c74dfd0956c0fa22ce3b5b5e30b5e17ea584db1cc193ac7fdc72daff68c9163dbc46a837e01d25a7a4a90e0 0018-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +fc5ce12cd70382b15317931ff0f57ae1ed10e8c09dbf2fee627bc55a268f55ebbf9ae32b89b4ef6f51e9a9b7ca32eed201245d481cde88f6eb572d40134f5f4c 0019-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +e0d4fd0e0bf4ecfb517b60b55d73f326deda0faa75bfd07d1fcae116f91088a96caaa2dd20e2e38a93cc8ffed0aef422c0c861879c8de406364faef0cbcd50ff 0020-aarch64-disable-multilib-support.patch +7af318ea6fe14dce98b8db1f8f46a2dc9f75c2f27e63a52c62c7b47d6d62cb64748d5c2690eba772d931ff96ac089e3f03bf46b49122ffb5a03a1c186f01ae11 0021-s390x-disable-multilib-support.patch +b96dbbd0e1aa98ebc2e7eaa2a44912681e4c8bc9a129fafa53a943d67b62451b6d4fad53f92429cd4346a753527359c8c09d58836cf0968a56f5fe933496a412 0022-ppc64-le-disable-multilib-support.patch +60106cb08f27c89509ba46dc2ff0edecc1f4c7973874c85047dfdd67eabe50e3a852d7540002a09bcb6185c786a5daeba7915958c441fc92d7f16a0cce5bcdea 0023-x86_64-disable-multilib-support.patch +d55d65242af9341eef7f1e3d03fec2e2de75632a23ed83df4fe6304619f62127b42eba9d9286f7f3647e3b9bd95aaeb79023263e71ff9d58c47f3051b73d8bc2 0024-riscv-disable-multilib-support.patch +b6dda179cafbd9e7f3ef7e137b303a76491a0157d68f1504dee6611cecdca16d27ca32cbd2298da2f6301e7167b8730d70a775ee5ba88ae3773adef8421efa98 0025-always-build-libgcc_eh.a.patch +95245b6548ddca5065bac06131294028767a32740c80f707a4d1cf8653a0398305ec68e7c44a3f2912741b792d41048f03729657b0a1c1a2a7bff097c6b2fdc7 0026-ada-libgnarl-remove-use-of-glibc-specific-pthread_rw.patch +ff6b8b9e1ab9b45d1853e74befb5c904cf7cd83dadb5a4b6f8c94a75e6249d1cdaa72aef73d6b1045beabc2d9012ea869d886015ec3aae561eb4ba8b9d00c2d7 0027-ada-libgnarl-use-posix_openpt-instead-of-glibc-speci.patch +0582f00e8801df06e51fca45a8dc3ee62e9b6ce9245af98937f435c90c709edc7eb9071569c0e59c9a143d964fe5731b9e11b011174443b97043abddc9db1cce 0028-ada-libgnarl-adaint-fix-sched.h-inclusion-for-musl.patch +8683314212c0a6f49ed45ea8c74908f59d863822fa8c99e94c7e39ba3a642ca6a3167543e1ae4b58d8acd1ff97824d6e60cc432b19e6580cad2027e3a5c37603 0029-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch +60bb67f6cf4b92243dec861fba702aa5847925bf413c2c83705a0ee4ebe4c523cc295cce29666c69c9b2dec70d63def83cd9074e613b4f46e014248f53c87db4 0030-configure-fix-detection-of-atomic-builtins-in-libato.patch +b49f72cce409f74407761fe64b028e97d58e4f236af7d9099189a8553f2ece3f30559760fab768f3d1fc4c7f89ae3ee6d687018251f3df52c9a43817c9c7c93e 0031-libstdc-do-not-throw-exceptions-for-non-C-locales-on.patch +0bd3aa81590d5f47205e193d2998bb5986cbb82adb75e3d39dcf820625bb358d380d1695ebbb18437fdd935ce350b0f5b7364a5fa7c8e07ebe8f972c8cd46cd1 0032-gdc-unconditionally-link-libgphobos-against-libucont.patch +e8d5c4159f41fcb09e76758768d127ff366c93095137b694a405e9dbba88f2036ba64b69ac6c5c75e488be3281a1227cccbadcea2bef6f60ba0be7fc3d7db754 0033-druntime-link-against-libucontext-on-all-platforms.patch +6f530cdb1935296925ec29be7a30e4d69cebc155695db6ea30ee95ce65de7e8917e2a6148d3668974715120e7f13f734e5c36bfd35f707f4725a7556cbc1caa5 0034-libgnat-time_t-is-always-64-bit-on-musl-libc.patch +1dabb0c8d581ec86d8758dfa3d2f1713d915f6d927639f56b3590ed9b0885dfdf452e30ca87edac49721d2dc43d4fbdb4d178f8448e8ba5cc595457f216bf210 0035-libphobos-do-not-use-LFS64-symbols.patch +b915a0eaf7cc3e48f41f31ebbd9142760891b9ede304ff3f1dc7166f85a9e3f82017a17bb7e65824d3da07445b2c8bcd156a992eed92633362c08329b04b6cb4 0036-libgo-fix-lfs64-use.patch +0164467e66719187b6041c8d2d717a9bcd5b8c801dab6391b0e503c41e26518cc78389c97bdd2b2bc64f660f95410439aaa8a20799ec01eab17e7ba415ac1dd9 0037-loongarch-disable-multilib-support.patch +2cae2cb470b2cf469973c0ff3a7a020960cf4325502ff6c84c6b1b3514c8cacfae8452b5c79b55e657b0877fc9d81cc68db6f650156ca6d1376c1bd1a2290d8b 0038-static-PIE-ensure-static-reaches-the-linker.patch +7d73041566678fc86885877d8315481bf358858cbe54227356d5ab48623e435426ac7ff6e54d21b9fee4cc73e3f4bc7ef646d3e4ab1970e524c890cd1f735905 0039-except-Don-t-use-the-cached-value-of-the-gcc_except_.patch +4556ead97907ec76aaa7dde450e4b6068f87268c49168eeb2af0c3df1dfa312b0a4a947b65b11fd413dae9af0beb3ef002d077c0d7f43b0bc466d3cd4348e657 0040-ada-libgnat-use-stub-symbolic-module-name-functions.patch +389eacbeba976a461af3d087d732d1c4f2a38bc5db91b935149e60ad4b210286ba76688b8a947d00f324566b6789152bf3b93a188fa2fb7ee8042786df483fed 0041-ada-libgnat-recognize-linux-musleabi-and-linux-muslg.patch "