diff --git a/cross/gcc-aarch64/0001-posix_memalign.patch b/cross/gcc-aarch64/0001-posix_memalign.patch index afb68c185..826200e09 100644 --- a/cross/gcc-aarch64/0001-posix_memalign.patch +++ b/cross/gcc-aarch64/0001-posix_memalign.patch @@ -1,7 +1,7 @@ -From 399f9e74a691ca6272d460d72d1b47afcad84752 Mon Sep 17 00:00:00 2001 +From 4ed2cc3054f444c683f54954c32e586a54066337 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/30] posix_memalign +Subject: [PATCH 01/39] posix_memalign --- gcc/config/i386/pmm_malloc.h | 9 +++++---- @@ -38,5 +38,5 @@ index 87344d9383f..ece428df487 100644 else return NULL; -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0002-gcc-poison-system-directories.patch b/cross/gcc-aarch64/0002-gcc-poison-system-directories.patch index e388dd1be..6dec763f8 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 0e993b1b9a33910193862d76facf34bdbe58ed01 Mon Sep 17 00:00:00 2001 +From 09a32a40b34477cd787deb12833c063a09dea7b2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/30] gcc: poison-system-directories +Subject: [PATCH 02/39] gcc: poison-system-directories Add /sw/include and /opt/include based on the original zecke-no-host-includes.patch patch. The original patch checked for @@ -26,7 +26,7 @@ Upstream-Status: Pending 7 files changed, 68 insertions(+) diff --git a/gcc/common.opt b/gcc/common.opt -index 3ec7743eae8..d3c3e51dcb0 100644 +index dfed6ec76ba..8bb65e0e1af 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -682,6 +682,10 @@ Wreturn-local-addr @@ -58,7 +58,7 @@ index 364eba47737..9551c0dfdf9 100644 optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive. */ diff --git a/gcc/configure b/gcc/configure -index eb6061c1631..90e3be864f8 100755 +index b4088d8fd1e..793530e21cf 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1010,6 +1010,7 @@ with_system_zlib @@ -78,7 +78,7 @@ index eb6061c1631..90e3be864f8 100755 --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --disable-libquadmath-support -@@ -30266,6 +30269,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -30271,6 +30274,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -99,10 +99,10 @@ index eb6061c1631..90e3be864f8 100755 diff --git a/gcc/configure.ac b/gcc/configure.ac -index 715fcba0482..f42006e5476 100644 +index 070b9c6c497..0fd438e39e5 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6600,6 +6600,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -6605,6 +6605,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) @@ -120,7 +120,7 @@ index 715fcba0482..f42006e5476 100644 AC_SUBST(subdirs) AC_SUBST(srcdir) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index a2794a67d1e..dfed8fd25a8 100644 +index 0d532a64bfe..86e57038042 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}. @@ -131,7 +131,7 @@ index a2794a67d1e..dfed8fd25a8 100644 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol -Wrestrict -Wno-return-local-addr -Wreturn-type @gol -Wno-scalar-storage-order -Wsequence-point @gol -@@ -6924,6 +6925,14 @@ made up of data only and thus requires no special treatment. But, for +@@ -6926,6 +6927,14 @@ made up of data only and thus requires no special treatment. But, for most targets, it is made up of code and thus requires the stack to be made executable in order for the program to work properly. @@ -199,5 +199,5 @@ index 8a2bda00f80..9098ab044ab 100644 /* Use given -I paths for #include "..." but not #include <...>, and -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch b/cross/gcc-aarch64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch index 511636e52..ab9cc6d94 100644 --- a/cross/gcc-aarch64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch +++ b/cross/gcc-aarch64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -1,7 +1,7 @@ -From a35a55940c3402f8ebb510ec7d8bc67e85051277 Mon Sep 17 00:00:00 2001 +From 77e75a23e9bdf8863823225567c509b6fed49e6e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default. +Subject: [PATCH 03/39] Turn on -Wl,-z,relro,-z,now by default. --- gcc/doc/invoke.texi | 3 +++ @@ -9,10 +9,10 @@ Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default. 2 files changed, 4 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index dfed8fd25a8..ca56d52cb05 100644 +index 86e57038042..87ff404bc20 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -14638,6 +14638,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -14645,6 +14645,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}. @@ -35,5 +35,5 @@ index b2200c5185a..625c9ab7902 100644 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ %{Wno-poison-system-directories:--no-poison-system-directories} \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch b/cross/gcc-aarch64/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch index d2b423318..5a652beab 100644 --- a/cross/gcc-aarch64/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +++ b/cross/gcc-aarch64/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch @@ -1,7 +1,7 @@ -From d2865d0a184ef59be8893dd34edf5037c4bf48f7 Mon Sep 17 00:00:00 2001 +From 3b76b0c848746d4adbc4e8db408efd41aefb829c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/30] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, +Subject: [PATCH 04/39] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, if the optimization level is > 0 --- @@ -25,10 +25,10 @@ index db91a36794a..ed976c71404 100644 if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index ca56d52cb05..f5d5a1d1542 100644 +index 87ff404bc20..01e67e97491 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -9228,6 +9228,12 @@ also turns on the following optimization flags: +@@ -9230,6 +9230,12 @@ also turns on the following optimization flags: Please note the warning under @option{-fgcse} about invoking @option{-O2} on programs that use computed gotos. @@ -42,5 +42,5 @@ index ca56d52cb05..f5d5a1d1542 100644 @opindex O3 Optimize yet more. @option{-O3} turns on all optimizations specified -- -2.27.0 +2.28.0 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 41206fa9f..b60112aa3 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,7 +1,7 @@ -From 872e0a15a2b74cd6b6ba58e2e7e1605543ea36bd Mon Sep 17 00:00:00 2001 +From 483912c560424ee8b5cc996990d45802671fc73f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/30] On linux targets pass --as-needed by default to the +Subject: [PATCH 05/39] On linux targets pass --as-needed by default to the linker, but always link the sanitizer libraries with --no-as-needed. --- @@ -192,10 +192,10 @@ index 6919b468f06..56d52d41b31 100644 %{!shared: \ %{static:-static} \ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h -index 81201e67a2f..6477d7ec52e 100644 +index 63853e60c03..de6d8675456 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h -@@ -87,7 +87,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); +@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" #undef LINK_SPEC @@ -265,5 +265,5 @@ index 625c9ab7902..7aec9d3a016 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.27.0 +2.28.0 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 37ab133e9..01d7d7d29 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,7 +1,7 @@ -From 5e20872b8cc916cb457c63c6cd970c4fcba47bbb Mon Sep 17 00:00:00 2001 +From c57a8b43401ca9a1b889fa9fd421ac49c3dbd380 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/30] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH 06/39] Enable -Wformat and -Wformat-security by default. --- gcc/c-family/c.opt | 4 ++-- @@ -30,5 +30,5 @@ index c49da99d395..93f25319005 100644 Wformat-overflow= -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch index 31a7faa03..c2d64dff7 100644 --- a/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-aarch64/0007-Enable-Wtrampolines-by-default.patch @@ -1,14 +1,14 @@ -From 1bcf7e30226852db956becebaffdfe2738923423 Mon Sep 17 00:00:00 2001 +From a58dad2c52639422671ac6986c36e48499fc2f20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/30] Enable -Wtrampolines by default. +Subject: [PATCH 07/39] Enable -Wtrampolines by default. --- gcc/common.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt -index d3c3e51dcb0..7b68397c232 100644 +index 8bb65e0e1af..ace932b300d 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning @@ -21,5 +21,5 @@ index d3c3e51dcb0..7b68397c232 100644 Wtype-limits -- -2.27.0 +2.28.0 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 index 0b3ce1a78..f7d30e3b0 100644 --- 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 @@ -1,7 +1,7 @@ -From 23fd86ff34670873dd294bd87b93f45c3624903a Mon Sep 17 00:00:00 2001 +From 98b2b8f7de60ed1b6b7602124ef6db278cf3c212 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/30] Disable ssp on -nostdlib, -nodefaultlibs and +Subject: [PATCH 08/39] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding Change the buffer size. --- @@ -49,5 +49,5 @@ index 4aec480798b..eaecfab37ad 100644 -param=stack-clash-protection-guard-size= -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index 0e059262e..f8f8eea78 100644 --- a/cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-aarch64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,7 +1,7 @@ -From d27d7936ecd9f357a3c6ee05e6548f8a68fdd4b7 Mon Sep 17 00:00:00 2001 +From 035775ef38206ed2859500efe5fb42ceec2e858d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/30] Ensure that msgfmt doesn't encounter problems during +Subject: [PATCH 09/39] Ensure that msgfmt doesn't encounter problems during gcc bootstrapping. Solves error messages like the following: @@ -50,5 +50,5 @@ index a0f84b0cfa0..ab24a47a2fd 100644 all-local: all-local-$(USE_NLS) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch index d85b7c593..49118500f 100644 --- a/cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-aarch64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,7 +1,7 @@ -From 2ec258d6d31e2c0c614c5086acee84a87768a67c Mon Sep 17 00:00:00 2001 +From e9875d74e75c601b95dba677bc9e58c869150212 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/30] Don't declare asprintf if defined as a macro. +Subject: [PATCH 10/39] Don't declare asprintf if defined as a macro. --- include/libiberty.h | 3 +++ @@ -24,5 +24,5 @@ index 141cb886a85..fa0e78eb62f 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch index 770cad546..6a1450675 100644 --- a/cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-aarch64/0011-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,7 +1,7 @@ -From 4f6fd2272f57620da399d0f841fce12b9db3b2d1 Mon Sep 17 00:00:00 2001 +From 764e64bba73a7b7eb5154c8537781412252ed33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/30] libiberty: copy PIC objects during build process +Subject: [PATCH 11/39] libiberty: copy PIC objects during build process --- libiberty/Makefile.in | 1 + @@ -20,5 +20,5 @@ index d6b302e02fd..fd39928546f 100644 else true; fi -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0012-libitm-disable-FORTIFY.patch b/cross/gcc-aarch64/0012-libitm-disable-FORTIFY.patch index 169361398..ba2e1fa9f 100644 --- a/cross/gcc-aarch64/0012-libitm-disable-FORTIFY.patch +++ b/cross/gcc-aarch64/0012-libitm-disable-FORTIFY.patch @@ -1,7 +1,7 @@ -From cef5e0336cfdf4afd0e01fa9e562f686b234697a Mon Sep 17 00:00:00 2001 +From da46d99b1b7661a98064a45bdccf08c1867582b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:36 +0000 -Subject: [PATCH 12/30] libitm: disable FORTIFY +Subject: [PATCH 12/39] libitm: disable FORTIFY --- libitm/configure.tgt | 10 ++++++++++ @@ -29,5 +29,5 @@ index 04109160e91..107b957ece3 100644 # work out any special compilation flags as necessary. case "${target_cpu}" in -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0013-libgcc_s.patch b/cross/gcc-aarch64/0013-libgcc_s.patch index f04d7f7c0..d0636b2bc 100644 --- a/cross/gcc-aarch64/0013-libgcc_s.patch +++ b/cross/gcc-aarch64/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From d31721459e363e49dfe0a7797300864d9cef92f0 Mon Sep 17 00:00:00 2001 +From 354f2a8ceb70f9f6e1688ba41c1cc1c17ac87329 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 13/30] libgcc_s +Subject: [PATCH 13/39] libgcc_s --- gcc/config/i386/i386-expand.c | 4 ++-- @@ -10,10 +10,10 @@ Subject: [PATCH 13/30] libgcc_s 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c -index 6c759b01edf..8cf0e069e1c 100644 +index c6033688f51..a60e5162995 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c -@@ -10948,10 +10948,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -10966,10 +10966,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -53,5 +53,5 @@ index 8506a635790..564296f788e 100644 +HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) CRTSTUFF_T_CFLAGS += $(CET_FLAGS) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0014-nopie.patch b/cross/gcc-aarch64/0014-nopie.patch index 086031937..ed8f503c8 100644 --- a/cross/gcc-aarch64/0014-nopie.patch +++ b/cross/gcc-aarch64/0014-nopie.patch @@ -1,7 +1,7 @@ -From f64f853eae3b390adbbc9b74a336d93918e6dca4 Mon Sep 17 00:00:00 2001 +From 7fb84007ff62309abffdbddfa751e69c331e82c3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 14/30] nopie +Subject: [PATCH 14/39] nopie --- gcc/configure | 27 +++++++++++++++++++++++++++ @@ -9,10 +9,10 @@ Subject: [PATCH 14/30] nopie 2 files changed, 40 insertions(+) diff --git a/gcc/configure b/gcc/configure -index 90e3be864f8..951a093b459 100755 +index 793530e21cf..2d874d3defe 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -30774,6 +30774,33 @@ fi +@@ -30779,6 +30779,33 @@ fi $as_echo "$gcc_cv_no_pie" >&6; } if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -47,10 +47,10 @@ index 90e3be864f8..951a093b459 100755 diff --git a/gcc/configure.ac b/gcc/configure.ac -index f42006e5476..fe392298016 100644 +index 0fd438e39e5..0b257e687ee 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6858,6 +6858,19 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -6863,6 +6863,19 @@ AC_CACHE_CHECK([for -no-pie option], LDFLAGS="$saved_LDFLAGS"]) if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -71,5 +71,5 @@ index f42006e5476..fe392298016 100644 AC_SUBST([NO_PIE_FLAG]) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch b/cross/gcc-aarch64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch index 8f007668f..b7bd1857f 100644 --- a/cross/gcc-aarch64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +++ b/cross/gcc-aarch64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch @@ -1,7 +1,7 @@ -From 37dace030c1402a8e6734a0fc59e18717ce1a2ef Mon Sep 17 00:00:00 2001 +From 3f764eb6dc371cc48cfdf231cbd40e64b1f2a671 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:57:09 +0000 -Subject: [PATCH 15/30] libffi: use __linux__ instead of __gnu_linux__ for musl +Subject: [PATCH 15/39] libffi: use __linux__ instead of __gnu_linux__ for musl --- libffi/src/closures.c | 2 +- @@ -21,5 +21,5 @@ index 721ff00ea43..22a699c6340 100644 with both write and execute permission. Code compiled when this option is defined will attempt to map such pages once, but if it -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0016-dlang-update-zlib-binding.patch b/cross/gcc-aarch64/0016-dlang-update-zlib-binding.patch index 9204db8a8..b2dcb0eb1 100644 --- a/cross/gcc-aarch64/0016-dlang-update-zlib-binding.patch +++ b/cross/gcc-aarch64/0016-dlang-update-zlib-binding.patch @@ -1,7 +1,7 @@ -From 7fc386a2e629e859968da4eb4d0ff4983cb3b76f Mon Sep 17 00:00:00 2001 +From b78dea0f8f09d4092bec52b7ada719ead2552dd2 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:57:51 +0000 -Subject: [PATCH 16/30] dlang: update zlib binding +Subject: [PATCH 16/39] dlang: update zlib binding --- libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++----------- @@ -421,5 +421,5 @@ index e6cce240fd5..bd2fe37ebec 100644 } -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch b/cross/gcc-aarch64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch index 7b11d6bae..570c44c4b 100644 --- a/cross/gcc-aarch64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +++ b/cross/gcc-aarch64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch @@ -1,7 +1,7 @@ -From ef5f7880cff27a2b92952ce53a207d5dd896923b Mon Sep 17 00:00:00 2001 +From 58c529af8a9673b90dc7137065ab788c25b358a8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:58:22 +0000 -Subject: [PATCH 17/30] dlang: fix fcntl on mips, add libucontext dep +Subject: [PATCH 17/39] dlang: fix fcntl on mips, add libucontext dep --- libphobos/configure.tgt | 1 + @@ -47,5 +47,5 @@ index 9febcff849b..cb34e2108bd 100644 static assert(0, "Platform not supported"); -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0018-ada-fix-shared-linking.patch b/cross/gcc-aarch64/0018-ada-fix-shared-linking.patch index 1fc9b372b..6486564c1 100644 --- a/cross/gcc-aarch64/0018-ada-fix-shared-linking.patch +++ b/cross/gcc-aarch64/0018-ada-fix-shared-linking.patch @@ -1,7 +1,7 @@ -From b675e0383262d6d702f5b732e4459d3e2c2a4891 Mon Sep 17 00:00:00 2001 +From 2a614f9b702b02c312cd513eddb1fc6745f9a3ad Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 18/30] ada: fix shared linking +Subject: [PATCH 18/39] ada: fix shared linking --- gcc/ada/link.c | 12 ++++++------ @@ -38,5 +38,5 @@ index 02c413a412f..f0e52a87d6e 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-aarch64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index 591f9ffa3..788c0fb9b 100644 --- a/cross/gcc-aarch64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-aarch64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,7 +1,7 @@ -From 0ea91dd6f8d856d5b589c2a3e95469fea06e7094 Mon Sep 17 00:00:00 2001 +From dab36b973223e0d6853f564e845bc22dadcc4d2d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 19/30] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH 19/39] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + @@ -20,5 +20,5 @@ index 36e369df6e7..63627db68cf 100644 # This is the list of directories to built for the host system. -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0020-libstdc-futex-add-time64-compatibility.patch b/cross/gcc-aarch64/0020-libstdc-futex-add-time64-compatibility.patch index 73d7f0730..8d5f43888 100644 --- a/cross/gcc-aarch64/0020-libstdc-futex-add-time64-compatibility.patch +++ b/cross/gcc-aarch64/0020-libstdc-futex-add-time64-compatibility.patch @@ -1,7 +1,7 @@ -From 9684a815e1cbe854383c3c511e1d84d43c46ec94 Mon Sep 17 00:00:00 2001 +From c2efb7703c2ef381a8b1d1cd751222e0a7e10665 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:00:17 +0000 -Subject: [PATCH 20/30] libstdc++: futex: add time64 compatibility +Subject: [PATCH 20/39] libstdc++: futex: add time64 compatibility --- libstdc++-v3/src/c++11/futex.cc | 8 ++++++++ @@ -28,5 +28,5 @@ index c9de11a7ec7..7be702dbeda 100644 rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; if (rt.tv_nsec < 0) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0021-add-fortify-headers-paths.patch b/cross/gcc-aarch64/0021-add-fortify-headers-paths.patch index 81e26a47e..0d14a614b 100644 --- a/cross/gcc-aarch64/0021-add-fortify-headers-paths.patch +++ b/cross/gcc-aarch64/0021-add-fortify-headers-paths.patch @@ -1,7 +1,7 @@ -From a0708ec975c01b049d254dc51179898966bf8a52 Mon Sep 17 00:00:00 2001 +From ca8a8331acef15d0b3b095b8c63539acd1d93e8b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 21/30] add fortify-headers paths +Subject: [PATCH 21/39] add fortify-headers paths --- gcc/config/linux.h | 2 ++ @@ -21,5 +21,5 @@ index 95654bcdb5a..d88df8f154a 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-aarch64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index a93b372e9..5f1ae3c8c 100644 --- a/cross/gcc-aarch64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-aarch64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,7 +1,7 @@ -From 740342a0e4b0b3af498964440918abba1a27ba33 Mon Sep 17 00:00:00 2001 +From 23468db70f830e99ac138826d28cc33fa71d3405 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 22/30] Alpine musl package provides libssp_nonshared.a. We +Subject: [PATCH 22/39] 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 @@ -27,5 +27,5 @@ index daeb4d0c8ea..6920bec0fa0 100644 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-aarch64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index 4717d7416..8d0e39ba5 100644 --- a/cross/gcc-aarch64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-aarch64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,7 +1,7 @@ -From 775adf35d6f34f61947fc28a2bdbfa7e881c40d5 Mon Sep 17 00:00:00 2001 +From 67513cb76a43014172f54384c3bad0c41e949c8a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 23/30] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH 23/39] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- @@ -65,5 +65,5 @@ index 6920bec0fa0..40e07354b3d 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0024-Pure-64-bit-MIPS.patch b/cross/gcc-aarch64/0024-Pure-64-bit-MIPS.patch index 95cefb3dd..55021c8f8 100644 --- a/cross/gcc-aarch64/0024-Pure-64-bit-MIPS.patch +++ b/cross/gcc-aarch64/0024-Pure-64-bit-MIPS.patch @@ -1,7 +1,7 @@ -From 717090cf538f765db1730956c512a43f2d52a802 Mon Sep 17 00:00:00 2001 +From 5d9d38da4f523c052a5bcd2562d79809b4136f2c Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Thu, 21 Dec 2017 03:14:33 +0100 -Subject: [PATCH 24/30] Pure 64-bit MIPS +Subject: [PATCH 24/39] Pure 64-bit MIPS --- gcc/config/mips/mips.h | 8 ++++---- @@ -43,5 +43,5 @@ index ceb58d3b5f3..8116e23ebba 100644 + ../lib32 \ + ../lib -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0025-use-pure-64-bit-configuration-where-appropriate.patch b/cross/gcc-aarch64/0025-use-pure-64-bit-configuration-where-appropriate.patch index 8e2db4831..2c2d3030b 100644 --- a/cross/gcc-aarch64/0025-use-pure-64-bit-configuration-where-appropriate.patch +++ b/cross/gcc-aarch64/0025-use-pure-64-bit-configuration-where-appropriate.patch @@ -1,7 +1,7 @@ -From f73cf8d2f8f4eee71fc2ba850672e69f509a4486 Mon Sep 17 00:00:00 2001 +From ac0eeb3237ac2cf75c19be92afe3335c9a0d83bb Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:04:40 +0000 -Subject: [PATCH 25/30] use pure 64-bit configuration where appropriate +Subject: [PATCH 25/39] use pure 64-bit configuration where appropriate --- gcc/config/aarch64/t-aarch64-linux | 2 +- @@ -117,5 +117,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0026-always-build-libgcc_eh.a.patch b/cross/gcc-aarch64/0026-always-build-libgcc_eh.a.patch index b41f8e9ed..d89d12b8c 100644 --- a/cross/gcc-aarch64/0026-always-build-libgcc_eh.a.patch +++ b/cross/gcc-aarch64/0026-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From 8472f6d0037dcd19c44b1e95d95fbf937b3823e6 Mon Sep 17 00:00:00 2001 +From 3f35cf750117fa7cbceaf33e4bea008d0688bd93 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 26/30] always build libgcc_eh.a +Subject: [PATCH 26/39] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -47,5 +47,5 @@ index 851e7657d07..99ec513a1a6 100644 for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0027-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-aarch64/0027-ada-libgnarl-compatibility-for-musl.patch index f44caa24c..15b17fbbd 100644 --- a/cross/gcc-aarch64/0027-ada-libgnarl-compatibility-for-musl.patch +++ b/cross/gcc-aarch64/0027-ada-libgnarl-compatibility-for-musl.patch @@ -1,7 +1,7 @@ -From 4e1b3a26f558e7693853d3600ee677705e67406c Mon Sep 17 00:00:00 2001 +From 48342d154084bb9610b8f02f93fcfc2aa606595a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 27/30] ada: libgnarl compatibility for musl +Subject: [PATCH 27/39] ada: libgnarl compatibility for musl --- gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ @@ -131,5 +131,5 @@ index c45559e5ba0..0b0f173e7d4 100644 pragma Assert (Result in 0 | ENOMEM); -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0028-ada-musl-support-fixes.patch b/cross/gcc-aarch64/0028-ada-musl-support-fixes.patch index 8eb13422c..b776c58c5 100644 --- a/cross/gcc-aarch64/0028-ada-musl-support-fixes.patch +++ b/cross/gcc-aarch64/0028-ada-musl-support-fixes.patch @@ -1,7 +1,7 @@ -From 5e3d7d2f1e2448b6c5eb207f9251c437629e43bc Mon Sep 17 00:00:00 2001 +From 0d517a7c90f9e21616c8ad0c66e24c1554f6658c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 28/30] ada: musl support fixes +Subject: [PATCH 28/39] ada: musl support fixes --- gcc/ada/Makefile.rtl | 10 +++++----- @@ -219,5 +219,5 @@ index af4417fab90..bab6bf3ca87 100644 status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); #elif defined (USE_CLONE_DEVICE) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-aarch64/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch b/cross/gcc-aarch64/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch deleted file mode 100644 index 13500dafe..000000000 --- a/cross/gcc-aarch64/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch +++ /dev/null @@ -1,520 +0,0 @@ -From d6599f89ba558ec2a68d4bc4af15cf3513218054 Mon Sep 17 00:00:00 2001 -From: Richard Sandiford -Date: Mon, 3 Aug 2020 09:48:36 +0100 -Subject: [PATCH 29/30] c: Fix bogus vector initialisation error [PR96377] - -One of the problems in this PR was that if we had: - - vector_type1 array[] = { vector_value1 }; - -process_init_element would only treat vector_value1 as initialising -a vector_type1 if they had the same TYPE_MAIN_VARIANT. This has -several problems: - -(1) It gives confusing error messages if the vector types are - incompatible. (Tested by gcc.dg/pr96377-1.c.) - -(2) It means that we reject code that should be valid with - -flax-vector-conversions. (Tested by gcc.dg/pr96377-2.c.) - -(3) On arm and aarch64 targets, it means that we reject some - initializers that mix Advanced SIMD and standard GNU vectors. - These vectors have traditionally had different TYPE_MAIN_VARIANTs - because they have different mangling schemes. (Tested by - gcc.dg/pr96377-[3-6].c.) - -(4) It means that we reject SVE initializers that should be valid. - (Tested by gcc.target/aarch64/sve/gnu_vectors_[34].c.) - -(5) After r11-1741-g:31427b974ed7b7dd54e2 we reject: - - arm_neon_type1 array[] = { k ^ arm_neon_value1 }; - - because applying the binary operator to arm_neon_value1 strips - the "Advanced SIMD type" attributes that were added in that patch. - Stripping the attributes is problematic for other reasons though, - so that still needs to be fixed separately. - -g++.target/aarch64/sve/gnu_vectors_[34].C already pass. - -gcc/c/ - PR c/96377 - * c-typeck.c (process_init_element): Split test for whether to - recurse into a record, union or array into... - (initialize_elementwise_p): ...this new function. Don't recurse - into a vector type if the initialization value is also a vector. - -gcc/testsuite/ - PR c/96377 - * gcc.dg/pr96377-1.c: New test. - * gcc.dg/pr96377-2.c: Likewise. - * gcc.dg/pr96377-3.c: Likewise. - * gcc.dg/pr96377-4.c: Likewise. - * gcc.dg/pr96377-5.c: Likewise. - * gcc.dg/pr96377-6.c: Likewise. - * gcc.target/aarch64/pr96377-1.c: Likewise. - * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c: Likewise. - * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c: Likewise. - * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C: Likewise. - * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C: Likewise. - -(cherry picked from commit 7d599ad27b9bcf5165f87710f1abc64bbabd06ae) ---- - gcc/c/c-typeck.c | 59 ++++++++++++++----- - .../sve/acle/general-c++/gnu_vectors_3.C | 15 +++++ - .../sve/acle/general-c++/gnu_vectors_4.C | 15 +++++ - gcc/testsuite/gcc.dg/pr96377-1.c | 32 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-2.c | 31 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-3.c | 33 +++++++++++ - gcc/testsuite/gcc.dg/pr96377-4.c | 32 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-5.c | 33 +++++++++++ - gcc/testsuite/gcc.dg/pr96377-6.c | 32 ++++++++++ - gcc/testsuite/gcc.target/aarch64/pr96377-1.c | 20 +++++++ - .../sve/acle/general-c/gnu_vectors_3.c | 15 +++++ - .../sve/acle/general-c/gnu_vectors_4.c | 15 +++++ - 12 files changed, 317 insertions(+), 15 deletions(-) - create mode 100644 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C - create mode 100644 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C - create mode 100644 gcc/testsuite/gcc.dg/pr96377-1.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-2.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-3.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-4.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-5.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-6.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/pr96377-1.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c - -diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c -index eb4b641e6bb..58762f10a93 100644 ---- a/gcc/c/c-typeck.c -+++ b/gcc/c/c-typeck.c -@@ -9910,6 +9910,47 @@ output_pending_init_elements (int all, struct obstack * braced_init_obstack) - goto retry; - } - -+/* Expression VALUE coincides with the start of type TYPE in a braced -+ initializer. Return true if we should treat VALUE as initializing -+ the first element of TYPE, false if we should treat it as initializing -+ TYPE as a whole. -+ -+ If the initializer is clearly invalid, the question becomes: -+ which choice gives the best error message? */ -+ -+static bool -+initialize_elementwise_p (tree type, tree value) -+{ -+ if (type == error_mark_node || value == error_mark_node) -+ return false; -+ -+ gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type); -+ -+ tree value_type = TREE_TYPE (value); -+ if (value_type == error_mark_node) -+ return false; -+ -+ /* GNU vectors can be initialized elementwise. However, treat any -+ kind of vector value as initializing the vector type as a whole, -+ regardless of whether the value is a GNU vector. Such initializers -+ are valid if and only if they would have been valid in a non-braced -+ initializer like: -+ -+ TYPE foo = VALUE; -+ -+ so recursing into the vector type would be at best confusing or at -+ worst wrong. For example, when -flax-vector-conversions is in effect, -+ it's possible to initialize a V8HI from a V4SI, even though the vectors -+ have different element types and different numbers of elements. */ -+ if (gnu_vector_type_p (type)) -+ return !VECTOR_TYPE_P (value_type); -+ -+ if (AGGREGATE_TYPE_P (type)) -+ return type != TYPE_MAIN_VARIANT (value_type); -+ -+ return false; -+} -+ - /* Add one non-braced element to the current constructor level. - This adjusts the current position within the constructor's type. - This may also start or terminate implicit levels -@@ -10089,11 +10130,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype -- && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE -- || fieldcode == UNION_TYPE -- || gnu_vector_type_p (fieldtype))) -+ && initialize_elementwise_p (fieldtype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -@@ -10181,11 +10218,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype -- && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE -- || fieldcode == UNION_TYPE -- || gnu_vector_type_p (fieldtype))) -+ && initialize_elementwise_p (fieldtype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -@@ -10224,11 +10257,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != elttype -- && (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE -- || eltcode == UNION_TYPE -- || gnu_vector_type_p (elttype))) -+ && initialize_elementwise_p (elttype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C -new file mode 100644 -index 00000000000..e607d58d726 ---- /dev/null -+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "cannot convert" } -+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "cannot convert" } -+} -diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C -new file mode 100644 -index 00000000000..ac4e0d12ff8 ---- /dev/null -+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; -+ gnu_uint8_t arr3[] = { sve_s1 }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-1.c b/gcc/testsuite/gcc.dg/pr96377-1.c -new file mode 100644 -index 00000000000..2bf3f816331 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-1.c -@@ -0,0 +1,32 @@ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-2.c b/gcc/testsuite/gcc.dg/pr96377-2.c -new file mode 100644 -index 00000000000..f58b06d9076 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-2.c -@@ -0,0 +1,31 @@ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-3.c b/gcc/testsuite/gcc.dg/pr96377-3.c -new file mode 100644 -index 00000000000..66dce01f277 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-3.c -@@ -0,0 +1,33 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (__Int32x4_t i, __Int16x8_t h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-4.c b/gcc/testsuite/gcc.dg/pr96377-4.c -new file mode 100644 -index 00000000000..f7aaf490031 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-4.c -@@ -0,0 +1,32 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (__Int32x4_t i, __Int16x8_t h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-5.c b/gcc/testsuite/gcc.dg/pr96377-5.c -new file mode 100644 -index 00000000000..3d0c24befa6 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-5.c -@@ -0,0 +1,33 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { __Int16x8_t x; __Int32x4_t y; }; -+union u1 { __Int16x8_t x; __Int32x4_t y; }; -+union u2 { __Int32x4_t s; __Int16x8_t y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__Int16x8_t" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-6.c b/gcc/testsuite/gcc.dg/pr96377-6.c -new file mode 100644 -index 00000000000..165327fa292 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-6.c -@@ -0,0 +1,32 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { __Int16x8_t x; __Int32x4_t y; }; -+union u1 { __Int16x8_t x; __Int32x4_t y; }; -+union u2 { __Int32x4_t s; __Int16x8_t y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/pr96377-1.c b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c -new file mode 100644 -index 00000000000..51e3e36edfc ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c -@@ -0,0 +1,20 @@ -+/* { dg-options "" } */ -+ -+#include -+ -+struct aegis128_state { -+ uint8x16_t v[5]; -+}; -+ -+void foo(const void *key, const void *iv, const void *const0, const void *const1) -+{ -+ uint8x16_t k = vld1q_u8(key); -+ uint8x16_t kiv = k ^ vld1q_u8(iv); -+ struct aegis128_state st = {{ -+ kiv, -+ vld1q_u8(const1), -+ vld1q_u8(const0), -+ k ^ vld1q_u8(const0), -+ k ^ vld1q_u8(const1), -+ }}; -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c -new file mode 100644 -index 00000000000..0f1a2b0e46b ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "incompatible types" } -+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "incompatible types" } -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c -new file mode 100644 -index 00000000000..ac4e0d12ff8 ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; -+ gnu_uint8_t arr3[] = { sve_s1 }; -+} --- -2.27.0 - diff --git a/cross/gcc-armhf/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch b/cross/gcc-aarch64/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch similarity index 92% rename from cross/gcc-armhf/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch rename to cross/gcc-aarch64/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch index 6c1eb03b9..25bb335d0 100644 --- a/cross/gcc-armhf/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +++ b/cross/gcc-aarch64/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch @@ -1,7 +1,7 @@ -From 756d3163d2ee3ee21ad815ab6dfebe58e8c32965 Mon Sep 17 00:00:00 2001 +From 3d86ab883c2a67dc9828f73a3d84c9fdb202ec32 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:58:08 +0200 -Subject: [PATCH] gcc-go: Use _off_t type instead of _loff_t +Subject: [PATCH 29/39] gcc-go: Use _off_t type instead of _loff_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -43,3 +43,6 @@ index 88286c07b6e..f8f5cfb5011 100644 plwoff = &lwoff } n, err = splice(rfd, plroff, wfd, plwoff, len, flags) +-- +2.28.0 + diff --git a/cross/gcc-armv7/0032-gcc-go-Don-t-include-sys-user.h.patch b/cross/gcc-aarch64/0030-gcc-go-Don-t-include-sys-user.h.patch similarity index 82% rename from cross/gcc-armv7/0032-gcc-go-Don-t-include-sys-user.h.patch rename to cross/gcc-aarch64/0030-gcc-go-Don-t-include-sys-user.h.patch index 897dd6ec3..8150bebb1 100644 --- a/cross/gcc-armv7/0032-gcc-go-Don-t-include-sys-user.h.patch +++ b/cross/gcc-aarch64/0030-gcc-go-Don-t-include-sys-user.h.patch @@ -1,7 +1,7 @@ -From ba9db3417c93a42dbf994e7c18c021f5542aa354 Mon Sep 17 00:00:00 2001 +From da63b5262701f91a2261812332f2850be0180634 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:58:21 +0200 -Subject: [PATCH] gcc-go: Don't include sys/user.h +Subject: [PATCH 30/39] gcc-go: Don't include sys/user.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -25,3 +25,6 @@ index 0692fd41eb7..c8d987358d9 100644 #if defined(HAVE_SYS_UTSNAME_H) #include #endif +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch b/cross/gcc-aarch64/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch deleted file mode 100644 index 8543681f6..000000000 --- a/cross/gcc-aarch64/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 773021143288f5bf0dca1e3ee1f908f580f6fd9c Mon Sep 17 00:00:00 2001 -From: Peter Bergner -Date: Thu, 13 Aug 2020 13:40:39 -0500 -Subject: [PATCH 30/30] rs6000: ICE when using an MMA type as a function param - or return value [PR96506] - -PR96506 shows a problem where we ICE on illegal usage, namely using MMA -types for function arguments and return values. The solution is to flag -these illegal usages as errors early, before we ICE. - -2020-08-13 Peter Bergner - -gcc/ - PR target/96506 - * config/rs6000/rs6000-call.c (rs6000_promote_function_mode): Disallow - MMA types as return values. - (rs6000_function_arg): Disallow MMA types as function arguments. - -gcc/testsuite/ - PR target/96506 - * gcc.target/powerpc/pr96506.c: New test. - -(cherry picked from commit 0ad7e730c142ef6cd0ddc1491a89a7f330caa887) ---- - gcc/config/rs6000/rs6000-call.c | 34 ++++++++++- - gcc/testsuite/gcc.target/powerpc/pr96506.c | 66 ++++++++++++++++++++++ - 2 files changed, 99 insertions(+), 1 deletion(-) - create mode 100644 gcc/testsuite/gcc.target/powerpc/pr96506.c - -diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c -index 243601e90c1..37566780e54 100644 ---- a/gcc/config/rs6000/rs6000-call.c -+++ b/gcc/config/rs6000/rs6000-call.c -@@ -6076,8 +6076,30 @@ machine_mode - rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, - machine_mode mode, - int *punsignedp ATTRIBUTE_UNUSED, -- const_tree, int) -+ const_tree, int for_return) - { -+ /* Warning: this is a static local variable and not always NULL! -+ This function is called multiple times for the same function -+ and return value. PREV_FUNC is used to keep track of the -+ first time we encounter a function's return value in order -+ to not report an error with that return value multiple times. */ -+ static struct function *prev_func = NULL; -+ -+ /* We do not allow MMA types being used as return values. Only report -+ the invalid return value usage the first time we encounter it. */ -+ if (for_return -+ && prev_func != cfun -+ && (mode == POImode || mode == PXImode)) -+ { -+ /* Record we have now handled function CFUN, so the next time we -+ are called, we do not re-report the same error. */ -+ prev_func = cfun; -+ if (TYPE_CANONICAL (type) != NULL_TREE) -+ type = TYPE_CANONICAL (type); -+ error ("invalid use of MMA type %qs as a function return value", -+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); -+ } -+ - PROMOTE_MODE (mode, *punsignedp, type); - - return mode; -@@ -7028,6 +7050,16 @@ rs6000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) - machine_mode elt_mode; - int n_elts; - -+ /* We do not allow MMA types being used as function arguments. */ -+ if (mode == POImode || mode == PXImode) -+ { -+ if (TYPE_CANONICAL (type) != NULL_TREE) -+ type = TYPE_CANONICAL (type); -+ error ("invalid use of MMA operand of type %qs as a function parameter", -+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); -+ return NULL_RTX; -+ } -+ - /* Return a marker to indicate whether CR1 needs to set or clear the - bit that V.4 uses to say fp args were passed in registers. - Assume that we don't need the marker for software floating point, -diff --git a/gcc/testsuite/gcc.target/powerpc/pr96506.c b/gcc/testsuite/gcc.target/powerpc/pr96506.c -new file mode 100644 -index 00000000000..b1b40c5a5c8 ---- /dev/null -+++ b/gcc/testsuite/gcc.target/powerpc/pr96506.c -@@ -0,0 +1,66 @@ -+/* PR target/96506 */ -+/* { dg-do compile } */ -+/* { dg-require-effective-target power10_ok } */ -+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */ -+ -+extern void bar0(); -+extern void bar1(); -+extern void bar2(); -+extern void bar3(); -+ -+typedef __vector_pair vpair_t; -+typedef __vector_quad vquad_t; -+ -+/* Verify we flag errors on the following. */ -+ -+void -+foo0 (void) -+{ -+ __vector_pair v; -+ bar0 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */ -+} -+ -+void -+foo1 (void) -+{ -+ vpair_t v; -+ bar1 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */ -+} -+ -+void -+foo2 (void) -+{ -+ __vector_quad v; -+ bar2 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */ -+} -+ -+void -+foo3 (void) -+{ -+ vquad_t v; -+ bar3 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */ -+} -+ -+__vector_pair -+foo4 (__vector_pair *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */ -+{ -+ return *src; -+} -+ -+vpair_t -+foo5 (vpair_t *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */ -+{ -+ return *src; -+} -+ -+__vector_quad -+foo6 (__vector_quad *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */ -+{ -+ return *src; -+} -+ -+vquad_t -+foo7 (vquad_t *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */ -+{ -+ return *src; -+} --- -2.27.0 - diff --git a/cross/gcc-aarch64/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch b/cross/gcc-aarch64/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch similarity index 88% rename from cross/gcc-aarch64/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch rename to cross/gcc-aarch64/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch index 4584a3595..186e2d11b 100644 --- a/cross/gcc-aarch64/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch +++ b/cross/gcc-aarch64/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch @@ -1,7 +1,7 @@ -From a2da9c892a6b29a8067f20fda2d8a5e9a7b5193e Mon Sep 17 00:00:00 2001 +From 18d6d2d1f62a4232340696fb7d68d248c751e416 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:59:22 +0200 -Subject: [PATCH] gcc-go: Fix ucontext_t on PPC64 +Subject: [PATCH 31/39] gcc-go: Fix ucontext_t on PPC64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,3 +24,6 @@ index b429fdb2403..fd1c885f043 100644 #elif defined(__PPC__) && defined(_AIX) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; #elif defined(__aarch64__) && defined(__linux__) +-- +2.28.0 + diff --git a/cross/gcc-armhf/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch b/cross/gcc-aarch64/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch similarity index 92% rename from cross/gcc-armhf/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch rename to cross/gcc-aarch64/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch index 528bbb3c2..2ecd0ca01 100644 --- a/cross/gcc-armhf/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch +++ b/cross/gcc-aarch64/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch @@ -1,7 +1,7 @@ -From 1d0cd9bbbef7d1bd3f42ad493db8d08b539cba60 Mon Sep 17 00:00:00 2001 +From d9942a2e54f69dee9c03e5e4339a6c62473e6845 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:59:45 +0200 -Subject: [PATCH] gcc-go: Fix handling of signal 34 on musl +Subject: [PATCH 32/39] gcc-go: Fix handling of signal 34 on musl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -38,3 +38,6 @@ index 11e4ec436bd..fe866eacb27 100644 fi if test "${GOOS}" = "aix"; then +-- +2.28.0 + diff --git a/cross/gcc-armhf/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch b/cross/gcc-aarch64/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch similarity index 88% rename from cross/gcc-armhf/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch rename to cross/gcc-aarch64/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch index 683242458..2234e32e5 100644 --- a/cross/gcc-armhf/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +++ b/cross/gcc-aarch64/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch @@ -1,7 +1,7 @@ -From 956c8cc94e7aa487eb142905c319487d94dc621d Mon Sep 17 00:00:00 2001 +From 38e7c12086acae4507f9d5067f947431a28c34db Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:01:03 +0200 -Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap +Subject: [PATCH 33/39] gcc-go: Use int64 type as offset argument for mmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -33,3 +33,6 @@ index ba38ebaa9ab..3c9e5ce9461 100644 p := sysMmap(addr, n, prot, flags, fd, off) if uintptr(p) == _MAP_FAILED { return nil, errno() +-- +2.28.0 + diff --git a/cross/gcc-armv7/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch b/cross/gcc-aarch64/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch similarity index 88% rename from cross/gcc-armv7/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch rename to cross/gcc-aarch64/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch index aa6849135..40c515ee8 100644 --- a/cross/gcc-armv7/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +++ b/cross/gcc-aarch64/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch @@ -1,7 +1,8 @@ -From c3a80843b7502ec2bfb5f1e5b514658c5f9dd884 Mon Sep 17 00:00:00 2001 +From a4e800081081b00539bbb6fd8b5cf6b66504cfaa Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:02:28 +0200 -Subject: [PATCH] gcc-go: Fix st_{a,m,c}tim fields in generated sysinfo.go +Subject: [PATCH 34/39] gcc-go: Fix st_{a,m,c}tim fields in generated + sysinfo.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -32,3 +33,6 @@ index bd2ba32cba1..972e2c379bc 100755 -e 's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g' \ -e 's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g' \ -e 's/\([^a-zA-Z0-9_]\)_st_timespec_t\([^a-zA-Z0-9_]\)/\1StTimespec\2/g' \ +-- +2.28.0 + diff --git a/cross/gcc-armv7/0037-gcc-go-signal-34-is-special-on-musl-libc.patch b/cross/gcc-aarch64/0035-gcc-go-signal-34-is-special-on-musl-libc.patch similarity index 85% rename from cross/gcc-armv7/0037-gcc-go-signal-34-is-special-on-musl-libc.patch rename to cross/gcc-aarch64/0035-gcc-go-signal-34-is-special-on-musl-libc.patch index 89228cf8b..f4046862d 100644 --- a/cross/gcc-armv7/0037-gcc-go-signal-34-is-special-on-musl-libc.patch +++ b/cross/gcc-aarch64/0035-gcc-go-signal-34-is-special-on-musl-libc.patch @@ -1,7 +1,7 @@ -From 75e274b0819c9a77ca121113301d353f7aa91740 Mon Sep 17 00:00:00 2001 +From 57ccf0ad7f0c4b1f998ebfb6cdaa7d1876012d66 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:03:03 +0200 -Subject: [PATCH] gcc-go: signal 34 is special on musl libc +Subject: [PATCH 35/39] gcc-go: signal 34 is special on musl libc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,3 +24,6 @@ index c555712a03c..9e228580d37 100644 return _SIG_DFL } throw("sigaction read failure") +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch b/cross/gcc-aarch64/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch similarity index 85% rename from cross/gcc-aarch64/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch rename to cross/gcc-aarch64/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch index 3c21fedaf..08d9ca397 100644 --- a/cross/gcc-aarch64/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch +++ b/cross/gcc-aarch64/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch @@ -1,7 +1,7 @@ -From ff096af4402ab87a61eb3979b47246a3a1b4fa38 Mon Sep 17 00:00:00 2001 +From e6d4cdd4d03cceb01e8ed03bbe7d35b5798abc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 30 Aug 2020 19:26:53 +0200 -Subject: [PATCH] gcc-go: Prefer _off_t over _off64_t +Subject: [PATCH 36/39] gcc-go: Prefer _off_t over _off64_t musl does not seem to have _off64_t. --- @@ -25,3 +25,6 @@ index 972e2c379bc..8d6da15f983 100755 echo "type Mode_t _mode_t" >> ${OUT} echo "type Pid_t _pid_t" >> ${OUT} echo "type Uid_t _uid_t" >> ${OUT} +-- +2.28.0 + diff --git a/cross/gcc-armv7/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch b/cross/gcc-aarch64/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch similarity index 81% rename from cross/gcc-armv7/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch rename to cross/gcc-aarch64/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch index 30995e582..c5e4806fe 100644 --- a/cross/gcc-armv7/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +++ b/cross/gcc-aarch64/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch @@ -1,7 +1,7 @@ -From 56dc7cac03987e95915032161ff0f7d5a8b8bf36 Mon Sep 17 00:00:00 2001 +From ac54a2afa01a3ebb06346f8dac505f0babbbe1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 30 Aug 2020 19:27:51 +0200 -Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c +Subject: [PATCH 37/39] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c --- libgo/runtime/proc.c | 4 ++++ @@ -22,3 +22,6 @@ index 274ce01c0bf..92a540bdde9 100644 #ifndef SETCONTEXT_CLOBBERS_TLS static inline void +-- +2.28.0 + diff --git a/cross/gcc-armv7/0040-gcc-go-link-to-libucontext.patch b/cross/gcc-aarch64/0038-gcc-go-link-to-libucontext.patch similarity index 83% rename from cross/gcc-armv7/0040-gcc-go-link-to-libucontext.patch rename to cross/gcc-aarch64/0038-gcc-go-link-to-libucontext.patch index de59e07f6..5a626f601 100644 --- a/cross/gcc-armv7/0040-gcc-go-link-to-libucontext.patch +++ b/cross/gcc-aarch64/0038-gcc-go-link-to-libucontext.patch @@ -1,7 +1,7 @@ -From ead76eced040b588f9374646a188ba21abab2049 Mon Sep 17 00:00:00 2001 +From e456a63af7f0bd1f519de98e74f864be0f73572a Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 31 Aug 2020 08:59:40 +0200 -Subject: [PATCH] gcc-go: link to libucontext +Subject: [PATCH 38/39] gcc-go: link to libucontext --- Makefile.in | 2 +- @@ -20,3 +20,6 @@ index 63627db68cf..c7f1f84d683 100644 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.28.0 + diff --git a/cross/gcc-armv7/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch b/cross/gcc-aarch64/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch similarity index 83% rename from cross/gcc-armv7/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch rename to cross/gcc-aarch64/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch index 406a74d00..b3568a511 100644 --- a/cross/gcc-armv7/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch +++ b/cross/gcc-aarch64/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch @@ -1,7 +1,8 @@ -From 3f5ee6a593215fbd40975d801ff37cf81a3fced3 Mon Sep 17 00:00:00 2001 +From f3a1e98d6d4d546bfb749b91c1f3639df905c1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 31 Aug 2020 20:26:56 +0200 -Subject: [PATCH] gcc-go: Disable printing of unaccessible ppc64 struct members +Subject: [PATCH 39/39] gcc-go: Disable printing of unaccessible ppc64 struct + members These struct members do not seem to exist on musl. --- @@ -21,3 +22,6 @@ index fd1c885f043..e845e453332 100644 { mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; int i; +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch b/cross/gcc-aarch64/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch deleted file mode 100644 index a3087c678..000000000 --- a/cross/gcc-aarch64/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 27a633f79c9a0248ce673ff2d9c397e136427b01 Mon Sep 17 00:00:00 2001 -From: None <@> -Date: Wed, 21 Oct 2020 17:35:50 +0000 -Subject: Backport of patch of the GCC 11 to avoid the GNU Attributes into - libgcc - -source: https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554770.html - -The -mno-gnu-attribute avoids the linker emit an error when check -the type of long double 128bit. - -Signed-off-by: Gustavo L F Walbon -Signed-off-by: Tulio Magno Quites Machado Filho ---- - main/gcc/t-float128 | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 -index d5413445..b4e1afab 100644 ---- a/libgcc/config/rs6000/t-float128 -+++ b/libgcc/config/rs6000/t-float128 -@@ -69,6 +69,17 @@ $(fp128_ppc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW) - $(fp128_obj) : $(fp128_includes) - $(fp128_obj) : $(srcdir)/config/rs6000/quad-float128.h - -+# If we are switching the default long double type, we need to use -+# -mno-gnu-attribute so that the __ibm128 support functions don't signal a -+# linker error since the default long double is now IEEE 128-bit instead of IBM -+# 128-bit. -+ibm-ldouble$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute -+ -+CFLAGS_TF_DECIMAL = -mno-gnu-attribute -Wno-psabi -mabi=ibmlongdouble -+CFLAGS_KF_DECIMAL = -mno-gnu-attribute -Wno-psabi -mabi=ieeelongdouble -+CFLAGS_KF_DECIMAL_SW = $(CFLAGS_KF_DECIMAL) -mno-float128-hardware -+$(TF_DECIMAL_OBJS) : INTERNAL_CFLAGS += $(CFLAGS_TF_DECIMAL) -+ - $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep) - @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \ - echo "Create $@"; \ --- -2.29.0 - diff --git a/cross/gcc-aarch64/APKBUILD b/cross/gcc-aarch64/APKBUILD index b8e2a913b..0868c75c6 100644 --- a/cross/gcc-aarch64/APKBUILD +++ b/cross/gcc-aarch64/APKBUILD @@ -24,13 +24,14 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-aarch64 -pkgver=10.2.0 +_pkgbase=10.2.1 +pkgver=10.2.1_pre0 [ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2" [ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-aarch64 -pkgrel=7 +pkgrel=0 pkgdesc="Stage2 cross-compiler for aarch64" url="https://gcc.gnu.org" arch="x86_64" @@ -169,7 +170,11 @@ if $LANG_ADA; then fi makedepends="$makedepends_build $makedepends_host" -source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# when using upstream releases, use this URI template +# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# +# right now, we are using a git snapshot +source="https://dev.alpinelinux.org/~nenolod/gcc-10.2.1.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -198,28 +203,25 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg 0026-always-build-libgcc_eh.a.patch 0027-ada-libgnarl-compatibility-for-musl.patch 0028-ada-musl-support-fixes.patch - 0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch - 0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch - 0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch - 0032-gcc-go-Don-t-include-sys-user.h.patch - 0033-gcc-go-Fix-ucontext_t-on-PPC64.patch - 0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch - 0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch - 0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch - 0037-gcc-go-signal-34-is-special-on-musl-libc.patch - 0038-gcc-go-Prefer-_off_t-over-_off64_t.patch - 0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch - 0040-gcc-go-link-to-libucontext.patch - 0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch - 0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch + 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch + 0030-gcc-go-Don-t-include-sys-user.h.patch + 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch + 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch + 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch + 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch + 0035-gcc-go-signal-34-is-special-on-musl-libc.patch + 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch + 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch + 0038-gcc-go-link-to-libucontext.patch + 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch " # gcc-4.8-build-args.patch # we build out-of-tree _gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver} -_gcclibdir="/usr/lib/gcc/$CTARGET/$pkgver" -_gcclibexec="/usr/libexec/gcc/$CTARGET/$pkgver" +_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}" +_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}" prepare() { cd "$_gccdir" @@ -242,7 +244,7 @@ prepare() { return 1 fi - echo ${pkgver} > gcc/BASE-VER + echo ${_pkgbase:-$pkgver} > gcc/BASE-VER } build() { @@ -648,46 +650,43 @@ gnat() { mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/ } -sha512sums="42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e gcc-10.2.0.tar.xz -ee2d344e912ebaddf71d53ff674ca7ea7837ee65f982a8f088339fd05261e441aace6087f7f936d32b502bff7e375094f48cb90562ab7734c57e1750d3fe2029 0001-posix_memalign.patch -deaf3ba25614df18b2b9b04244bcc9278c16d98f6fdeac17f7e2c0567be7c2836ab6d21fc9d8f779c672022d25fc278327d6d0d637bc200fadbb8d913ef95581 0002-gcc-poison-system-directories.patch -eb80ea94e008e33b97c8c0d47e74d639897a13357abbd130e9bff4ae30349b8f788acbaf4caa61f23022a86841c431b8bb639c536aab548dc735470a7c7ccfcf 0003-Turn-on-Wl-z-relro-z-now-by-default.patch -6cbc39dd24f7b4316b6e69940bf7c9f3ae889e8156f9c7dd72c8335e55a2a44d6fade37954296451b588bf8fc065514d4916ad527042b8f9a86d6e0d706e3c9c 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e8c75aef864e5852fc78bfd7949232fc58b40a743d7c04a122ee6e021ee99f72edcff6efbf74e0eedc9405faf81d01208867b0571c4dc8cb44b9a03d1d25fbde 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -d5b3d40e1c4828d16684137487f64bf0b4b892fabc403f975f37d481a22647f923a3524a12714898937abdfbf875411e50b522134535f8d1852f103310aef5a3 0006-Enable-Wformat-and-Wformat-security-by-default.patch -e568a17fb3348964c0d21e7d67ffeae4f2f0dfd3f2986aaf9cec86c685c13f0c830dfc019b6bd7fe58b8635e5b8fca7ad992a92210f2be285b8cac6467c33a78 0007-Enable-Wtrampolines-by-default.patch -fd47150c72138d47a9faafe8586e84456e09a4ca0ed1ba9be7b5b2a351b1ca2d17b238beaa42c88888402d181933ff68cef0a91f0c3bd26d374706cf71726bbd 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -820be83d93ff5b8d8fc69cdeccec0c6ac2544ee6cce43ae35e6829222791733a1c0b2232fb5a7ad93ab9e6cd677f077d01a4f9dec7aa9c38b013f74aa6c74fc3 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -5be4c0ad27e3b86c06dcaefe34ee1271cb53ded3de9802bc1a8571497240ca870e22534f77adb52dc4556eb4861b94a6c9a39cf6a2e84ef62ee88a04a4a01868 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -5024309e549b7e4a94f2af8bd727144bd27cf8b7cdcbb537a30f3dac28543697c214438da7af491e43cb90daac46344b7b0466729d5c4209ca8a3a0d5a7d027c 0011-libiberty-copy-PIC-objects-during-build-process.patch -c0ebc205f6598edbe6d68b8a287c36ef80826b864e5b92b37f64e7a21ab7048cae67dd5650cd3d1399beb890753ad96e898a94c52d13b3ca7b266a15fed043ca 0012-libitm-disable-FORTIFY.patch -4a4fae02231f49142ab90d4f3dcd093c13032781ff1659f6aca62da13f8c676e2ec9dcdd2e7959ec62835e13c515be9bd7a2e35d3c06768d44d9e1185cb40dac 0013-libgcc_s.patch -9c513a30146364ecd899ca26a27019ea1ba353e8e409e0becb50d2a051022b701586b9276a4f118dbdd131c4882a04cad4188219bb10aa36d7b0bbe2eb2ceb03 0014-nopie.patch -aec141251c3abae35b4dc3ecd3778e332fa5596282fea1fd08c8d5350d8a8740568910236ce8d38c5662232fa5412313cb0a1c7a46c79a5b5e2c643871bf643b 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch -d3fc4ea6918b4c4ce57eb45437f88ec3982bd5c8e17d282003e195dc705e0c84996ec140151b2b2371917595d2d62f30a2cb4676150c1bc8b8fd3b8fb85ecbe9 0016-dlang-update-zlib-binding.patch -4ebf845f41c7a8ba5bfa624c8e1527eb0f15a48d6a8bd151435037bd4b9d71f955ac9b60ab453c0315d592e92f194be92b9c3fca40ed533d64c0a1995c3ad4be 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch -2ca085382a03d269a2f48ec49601328cec7c53eb69856ee55aea11610293c206e8881043030d2295f49a08a5897c9eb9a6126a5ae65edbd967e17e34dadfb2d8 0018-ada-fix-shared-linking.patch -307a1ac2a6cea20c900b7bef2d5d7ad98c2b8cc45bdb2a6adbf151f3228d5de2670c75ddf48e4d3c9ceb7ed42852e24be534773551bc050ad10005faaee2600c 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -d01d0031d97fa42363bd3fb0c0dda9b26e7f06660294f0ceec55624f6564f2ce372b9a255683c67d79dfa18fb8551416c04766debc2e1b9c587ef381eef64f0b 0020-libstdc-futex-add-time64-compatibility.patch -e9eb5ff439cff4a22abaa7b9e27a176b51e1e1f4361fd829bd26e4b5ffc0e4583b1d6728b1510991b069b42f0aae8a2e698f85edecb1d792e4c7e10079507de8 0021-add-fortify-headers-paths.patch -beb7aa26a3731855be2521495186af52d4764973f2bc1ad44554332e867fe52fa37bcb5747395e44ae0011413e702054a60a754ad81dd88bbf97e3c7c718f356 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -ac3288b7840e5cf2500608773f40e604798b30fcb885c9fec7ba0bcc4bcfd374211faa26e82fcf4669bf624d5ccb0bdc747897759be77af3621b8b3bb08bff85 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -7e953227e0d3f1105a754f3fdefbaaca0b106d337c5bcc9b6394712d7f47173f96906517030b508d5a57611cc637848f2e59aec92313b39f1e2221bd98729826 0024-Pure-64-bit-MIPS.patch -12eaad6a8781e76f38bc4ba5c8cd09cfe0a0b95c0cde83fe58dc10bdec542fe43389f2c84bd313629c45af8ed3ffd46cc4478f5a4152ea1eb8d4b8276ede499c 0025-use-pure-64-bit-configuration-where-appropriate.patch -73a649ac371f4a5da68c5f0b88010080efd7deaee29765ef7a299fd1654b5ccdbfee88c59e5d37ae55e37cf6fa218d989e411c04b17e0fd94268ed65d7dcd4bf 0026-always-build-libgcc_eh.a.patch -59d9e0a5f39ad68b8bb1365f7c97a54ca4751cdad01ead8184fd897d8a13156145976a8b5b9856be154c053d6ba11eaad1e5662e7ddda9ba6d2811340df61cba 0027-ada-libgnarl-compatibility-for-musl.patch -8207323c530929517c799b24b1a7ba39c07bbb0e6770f878f1d66088ae16667e7706c9402ac04fe5eb6447a6ad12b548cc7e7612c5b217cd24e7d00094d2a28f 0028-ada-musl-support-fixes.patch -b90f7ad074b6183a4afc6be65349b8bf94b78d1c259d5be9877c16e3de95222fb6905cba7eb6ee4fe1e564ed20bf183c6815bd087896b6b0376656a841736fc1 0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch -39a66708fb7ab4a72e1973749e32c22484e8e6c0afde6a59a645f2536c71cea86c8de2f0448621d53888293121344e84a24617400fae849282df57e0f5ddc21d 0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch -ae0d860324b8b907ff82fcebe4777afae19df85b091723ac55425d24f677fb4e1d14ff4f21cdcdf837dcf730a4c48174e0cc31d1d003a5d11a88c226d5ed3e4a 0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch -a08ea6ce516dc96029153de096b96dcd3262509ee546f1f03152abe8f78c11c75b8dc14de39ccd982896114bf33d2edade2b4810dcc0b2d68e4abf52b67b8a41 0032-gcc-go-Don-t-include-sys-user.h.patch -3bbd3ab3d31fc81cbc6b641919a84807e52b59794f860cad83b9ff69bfd0f5f29aeefc5f19b203bc96db23bf6e5a6958690bd81caa3137eaa5111b5c465273b3 0033-gcc-go-Fix-ucontext_t-on-PPC64.patch -9c410c3a137a18559f1ae5ab5803d5bc8fc596a93da769b4ff2feec516602eb193333d18d55ce39e054b56726a5c243962e8ccdee001ae7e186b4222465b31a3 0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch -78af84111854f5d2de127f03fc0984ea1f9c2c87156be2c454cc88a6791c90817aed63aba2861657560b1d3bc182a31e3d74f7a946e56d831939870240625fb7 0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch -c0d47b5bc478b3e0943806806d81a9183b9d176148e31c75d50cdbb23a34d9c178d751a3fac743d94ebb44c7eae70d3c55ca115acedcf4a1a0bacf46c0c5cd5f 0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch -e9b523a34b5e2930e0c58ee19e903e5416fe65641df80c40937d445d4c8f4f4bde59b3a94a392f5ca0d1c4a87565bd655c186b3a5194cb5bce4de2864d5d025d 0037-gcc-go-signal-34-is-special-on-musl-libc.patch -d75147c2b062b0321b36d843c55887673d8bdac6448da465c29853ac5df3b68153551913476f2ea0fdb6d09df3992e47d457e480b3c16d99e6668b4f941e6e16 0038-gcc-go-Prefer-_off_t-over-_off64_t.patch -a60d2101f49d921cb538fd46650ba550f30721650b40e15fe8a56da32e5f2a3ea62f10d93982ffb45bee2e284cc006141b5d7a96fa12215d63b183b0a67c4c55 0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch -f08cfc9622e84a5a527b626dcca7199a430ab1c02588fef718bcb0155bc5af5a11888aa975e76e55cc2b9b70520a8bf1bcf939e5afe073f6263685686bc9c26f 0040-gcc-go-link-to-libucontext.patch -f27644461c8a3fd27026873639608e53a396e9b9d39c4f330c8eeba82bb9b1e68ae1bfb82c770424399a13762bb3ec147b2699b2cbbdca07628ab3896d806ce4 0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch -32f66f2886448206e216cdabcfd775f378a9fb879e0d0455cec7aec5b5004405175700736f4b48f3c364eab571b1561804b952f0a998103249ef94221bdf8ceb 0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch" +sha512sums="30c3e36c6e001d172b6219dbf5f0383655d29cbed8a197e1d6139213aacbfdb7cbca63553eedf3a4b35bd445a87ee0f555838d8b2cd7a46ab6bba7951a6b60c5 gcc-10.2.1.tar.xz +571e689369e1fd8a9281fed29f9ce5d35cdb6f892f5118216b2b171c5cd16ba5ab1f8f25f8438760bd26bc649b8f4703cc4e7a0918c250933398a37132fb3266 0001-posix_memalign.patch +2ca7d07543105955525e28a899f9cfbafa3f4f58cce8ae9931c20ddebe1126119a5001b8654e3ff7762f84de882dd609ae87f987b31a53dba6d6f5c7b6374a81 0002-gcc-poison-system-directories.patch +772b1bbae7c12cecef87d696603c523d5ea94a6c27f020f5873e6011479e43af735690a1137d4ec2a086946460ce4d411d5a9f00491015a73b04df39942d6dcd 0003-Turn-on-Wl-z-relro-z-now-by-default.patch +5d785525371fdfe89c5c36edf8c694083fc5d25870ef529473386de51e1db2f846d55a48087099230028acc1d076ad29c159603249aedc695cdf14844e2b26c7 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +f467e975f904c01339696f27113ddccac321ef205db4855d46a2a7e9f4ec93e5ab5f9adc19e36a4ef6f61e87fcf9b089ea0727f3ea9736561fb4e9eec4bbf9b0 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +49919bcbd59aea56be90e209d299ddb7b7a295d1db438a769279f4fe57ccf7a028a68227e31a22c1370037a4946a4c7c9ed5ac5044c163fb0f3795d3a2dc26cd 0006-Enable-Wformat-and-Wformat-security-by-default.patch +8374eaa22ef5f26d63226ded57042a8d7d2b69b415e3ff87ec2fc5046404dc062e2e096f329062d047d4e741ed2c5b58b6e1695cf070308f36c9558c6098fdcc 0007-Enable-Wtrampolines-by-default.patch +6be0db2455f5f678d37506773e4493a3cbaefd951486edb3374803813c749c2e6064218950cdc1c06f491fd95d4bd6ae9cbdf83148b332d172c20903eca03aa1 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +d1d1a87177623439a929b42af57a997b48d9e1f6a4ff06b4f84c5f027fc461473dd36145671d2d61b50c0acfcf028d3361be9c95b3340e6e336b012de84f4252 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +167cc80faa6a9daca1a990e87bfc268f27cb620fcd488405f24e397b9a1d6f51a0238d85be4a87f2db93fc1e06ff05d569ce0a2e2fe4db65ec44e15dfb66b994 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +85327918c409bf982c0dc13895324d6fc9cef1c68a3969ba5cf0a9450f2a04e3fa858af5ef7e432fc578cf6b0631cec55921bdcd361724c928eea943b4b5b2f3 0011-libiberty-copy-PIC-objects-during-build-process.patch +f65784f4eebec688f51598a306b9d034ba7feb0c6ac35a45e4f59585097fff820b3de90613941603985cdb5ee1a4c630381146bf2ee8429ffe80f0ffd5aa22c1 0012-libitm-disable-FORTIFY.patch +c489306880b493c92796e145dad372976ff90e42d8a97211e91db59bc75ca20244c96456dc806fd30f878f95878a37f4211f58b0f527b5808467a245186a0e14 0013-libgcc_s.patch +67a045fb5588eeb6776a98fbc0280a97e8b06e26909cab3e55346f6c81d87cf9ed7515afa3648b92ddd455e182fd5e44f6094e44f701676817f9d6fc3aad319e 0014-nopie.patch +b559a0f380065bd62d69359813e855819950a82c2361aa85771081de68bfe5d652936fbe5ad762f029016c643ffc8d62c0bf0e90460bd7d62a1c0f89ddcb5491 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +a42d56b0346208adb4a9f8575d53519c6303ead4eb498bed2ff36b9c20d904d9e1ba5996ec8ee35fb39ba91f30be28a6ab6c3c537a21078670c3ae88762b9a5b 0016-dlang-update-zlib-binding.patch +72313fd4829c8d153b8f4654863ff959597ac25fe657d641cfb5eafb42ae58662dd8581ac7a09eb6dadd2797e3585376fdd1f0207f23c061febdc37a85ea1ba1 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +8f695b5f60d2effca4144373fb0e2d3f1ce4a0c4465669ffb3dd771794b0e18da73b2c3e3644403e91c786ad0c42b54bfeac22543280d40c1a1c2b441c434410 0018-ada-fix-shared-linking.patch +c6800ce569e2da9a379bbb94f1f064833ba66ea1e4dc555e66c45f4ab9e83f40264ca0d06d161df469449b05ddf04907f890b39a1fa8a2bc3e530777d4896371 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +5557ec2a754cd64451a8f186397ff79c509d5781a3e32ba11e6ea45356b13d28ba0b959663540d25725e4bd20934c029a90343bed03b2c0bd143ea73c7f47281 0020-libstdc-futex-add-time64-compatibility.patch +1844d044b1eb3cc72ef72c7efb0623d08d62bbb059dcc254524a378bcc37193126eb52894f6acfea31240457e51c435e28573346d3a19d3d045d12846c07ff8d 0021-add-fortify-headers-paths.patch +210b6a16411c1e5fd00c96c06472c3b7713417ef6f48ea8d127482664d63db8ff5226be2cb2b93420e5f153d96b48e02ba4937d2ad7172c6a0e52ac91a050a2d 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +4a1daeb55c1103b9b52061eb08a3782307e4c9e1a72f4fc20aaa1ecca02931a9678d6a71cbcf8aaf8898da4c95ad639f8d04de07f169d95c16fc58d0db31602e 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +80729605dac33f225eebecbcf6c319e2839c6924483a13bc186092f15f325bf3e972f68328546e394d9e216de0b00e6601ba768b0bb2633ff8c3c0747bb7b1fd 0024-Pure-64-bit-MIPS.patch +ba222bd9ceb95ea9aa729618b95ee81299d20dd5a7840bff47a046d92247e1ea9e2f65d192b1570724da5898fa950a0b8692d505b5c27005d4b143301fd86a52 0025-use-pure-64-bit-configuration-where-appropriate.patch +67e4426be0aeab6b62d7b5e72443f4ea71e4f3fab096b734d656601ad47d44120ef1d9fc87dfef6af2808b39d21cc161cf3d3e45744bd79b56a1071bef5cde94 0026-always-build-libgcc_eh.a.patch +1f9a62459a511a97620147b357a8d1129d1f33a45b3db3a16e049e33b62c23886c37b10152254e84a86d0d2736de06e68e029cf96fa607cf52f15d58e4925b94 0027-ada-libgnarl-compatibility-for-musl.patch +d610a309aebc1aa3a13ce57a69a185b129b02e34cac0f25d7ea3b1dde28551de5e0acc8952b7c877d1f63cbf8f245fb78555d41fee6a55d4d5f68fe92b6a3037 0028-ada-musl-support-fixes.patch +dfa4e5da6206793c63cffef67cf02a443116e63649e6b0466d3c6e24082e5f14eb2640fb9b1b433d2cc4d4755804a360b1b4c572f50638f27169c9f2ef271bdc 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +22aec9116a2dc32add10efcf6bdc502933a318c668aaa9f01d9e7d6aebc1221fd8e6858abd610c556582f9cad0bc15ff7fbb08ca6c7fbe483c481cec3f361712 0030-gcc-go-Don-t-include-sys-user.h.patch +274b227d5d28e9c1d90ce1e29d5d88f938ea775cdd536bd51c8941a55994103ffb37222e395ab36b2fe4676aef106bb63bd510f73590e2ae434f4c6904454363 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch +3c06cf909d3b07a7de89c67afa6596fdc4ed4445ddc299d3b037dab8cb08828726aa7136576ba6b36f4c8b80451215bc356c8f9141b1e1420010f1ad5444943f 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch +f0b6f30c6d934c751ab5d58f3656ab80e02ceac12954a124600b09f2de350ad5a2081a09c2eb5c046fe1969af5022ac27b3bc0c0652cd1986b402334825ca92d 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +7800ae263f8510341cfc4b0daf5771e309f8ac1df9b8b9ad199eb6c792a13d1550f59584a89eda396514692e43940f5f52039cdef64f49a3e1b9ef40282d81be 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +33ae7f190b29667d2740e5f8edb6e69946f5601c3d87e2874cb7314bdfaef798223c018006a1d1932a547d1139ebbce08c3cb8b5f563413eb2ae64b9b8668a1e 0035-gcc-go-signal-34-is-special-on-musl-libc.patch +5f56cecf4b1a00c47c58d75ac8390009d80c8733e63cda90483cbbcb2e89d4e63778e475292378df77e6d2b81603dc43f27b8bb9a36ea384a429f501e6e88eed 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch +a4d3396a34e88723740fe52451992082974ddd2336257d173726f08955806349cbee9ddf1d9ec634365d374a0d61f6b28496ca326fba007b151bc3bed3097fa6 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +85e1f94113cf9e6be00be810b484b2098913ddb6b9f088351e0ae4d96afe5782d7c8687dacda1db8ee7487d14f67ef836bcfe890e94221b6c112c587e373afe0 0038-gcc-go-link-to-libucontext.patch +d332bf5b2af982776aacee359737145b636eaf373214fc58f66666ec6add5032ae1d2cbff6380c0791a0a8010f3c73a68407cd8908385a9bb2ba0295ea3e2370 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch" diff --git a/cross/gcc-armhf/0001-posix_memalign.patch b/cross/gcc-armhf/0001-posix_memalign.patch index afb68c185..826200e09 100644 --- a/cross/gcc-armhf/0001-posix_memalign.patch +++ b/cross/gcc-armhf/0001-posix_memalign.patch @@ -1,7 +1,7 @@ -From 399f9e74a691ca6272d460d72d1b47afcad84752 Mon Sep 17 00:00:00 2001 +From 4ed2cc3054f444c683f54954c32e586a54066337 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/30] posix_memalign +Subject: [PATCH 01/39] posix_memalign --- gcc/config/i386/pmm_malloc.h | 9 +++++---- @@ -38,5 +38,5 @@ index 87344d9383f..ece428df487 100644 else return NULL; -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0002-gcc-poison-system-directories.patch b/cross/gcc-armhf/0002-gcc-poison-system-directories.patch index e388dd1be..6dec763f8 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 0e993b1b9a33910193862d76facf34bdbe58ed01 Mon Sep 17 00:00:00 2001 +From 09a32a40b34477cd787deb12833c063a09dea7b2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/30] gcc: poison-system-directories +Subject: [PATCH 02/39] gcc: poison-system-directories Add /sw/include and /opt/include based on the original zecke-no-host-includes.patch patch. The original patch checked for @@ -26,7 +26,7 @@ Upstream-Status: Pending 7 files changed, 68 insertions(+) diff --git a/gcc/common.opt b/gcc/common.opt -index 3ec7743eae8..d3c3e51dcb0 100644 +index dfed6ec76ba..8bb65e0e1af 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -682,6 +682,10 @@ Wreturn-local-addr @@ -58,7 +58,7 @@ index 364eba47737..9551c0dfdf9 100644 optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive. */ diff --git a/gcc/configure b/gcc/configure -index eb6061c1631..90e3be864f8 100755 +index b4088d8fd1e..793530e21cf 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1010,6 +1010,7 @@ with_system_zlib @@ -78,7 +78,7 @@ index eb6061c1631..90e3be864f8 100755 --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --disable-libquadmath-support -@@ -30266,6 +30269,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -30271,6 +30274,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -99,10 +99,10 @@ index eb6061c1631..90e3be864f8 100755 diff --git a/gcc/configure.ac b/gcc/configure.ac -index 715fcba0482..f42006e5476 100644 +index 070b9c6c497..0fd438e39e5 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6600,6 +6600,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -6605,6 +6605,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) @@ -120,7 +120,7 @@ index 715fcba0482..f42006e5476 100644 AC_SUBST(subdirs) AC_SUBST(srcdir) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index a2794a67d1e..dfed8fd25a8 100644 +index 0d532a64bfe..86e57038042 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}. @@ -131,7 +131,7 @@ index a2794a67d1e..dfed8fd25a8 100644 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol -Wrestrict -Wno-return-local-addr -Wreturn-type @gol -Wno-scalar-storage-order -Wsequence-point @gol -@@ -6924,6 +6925,14 @@ made up of data only and thus requires no special treatment. But, for +@@ -6926,6 +6927,14 @@ made up of data only and thus requires no special treatment. But, for most targets, it is made up of code and thus requires the stack to be made executable in order for the program to work properly. @@ -199,5 +199,5 @@ index 8a2bda00f80..9098ab044ab 100644 /* Use given -I paths for #include "..." but not #include <...>, and -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0003-Turn-on-Wl-z-relro-z-now-by-default.patch b/cross/gcc-armhf/0003-Turn-on-Wl-z-relro-z-now-by-default.patch index 511636e52..ab9cc6d94 100644 --- a/cross/gcc-armhf/0003-Turn-on-Wl-z-relro-z-now-by-default.patch +++ b/cross/gcc-armhf/0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -1,7 +1,7 @@ -From a35a55940c3402f8ebb510ec7d8bc67e85051277 Mon Sep 17 00:00:00 2001 +From 77e75a23e9bdf8863823225567c509b6fed49e6e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default. +Subject: [PATCH 03/39] Turn on -Wl,-z,relro,-z,now by default. --- gcc/doc/invoke.texi | 3 +++ @@ -9,10 +9,10 @@ Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default. 2 files changed, 4 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index dfed8fd25a8..ca56d52cb05 100644 +index 86e57038042..87ff404bc20 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -14638,6 +14638,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -14645,6 +14645,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}. @@ -35,5 +35,5 @@ index b2200c5185a..625c9ab7902 100644 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ %{Wno-poison-system-directories:--no-poison-system-directories} \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch b/cross/gcc-armhf/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch index d2b423318..5a652beab 100644 --- a/cross/gcc-armhf/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +++ b/cross/gcc-armhf/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch @@ -1,7 +1,7 @@ -From d2865d0a184ef59be8893dd34edf5037c4bf48f7 Mon Sep 17 00:00:00 2001 +From 3b76b0c848746d4adbc4e8db408efd41aefb829c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/30] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, +Subject: [PATCH 04/39] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, if the optimization level is > 0 --- @@ -25,10 +25,10 @@ index db91a36794a..ed976c71404 100644 if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index ca56d52cb05..f5d5a1d1542 100644 +index 87ff404bc20..01e67e97491 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -9228,6 +9228,12 @@ also turns on the following optimization flags: +@@ -9230,6 +9230,12 @@ also turns on the following optimization flags: Please note the warning under @option{-fgcse} about invoking @option{-O2} on programs that use computed gotos. @@ -42,5 +42,5 @@ index ca56d52cb05..f5d5a1d1542 100644 @opindex O3 Optimize yet more. @option{-O3} turns on all optimizations specified -- -2.27.0 +2.28.0 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 41206fa9f..b60112aa3 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,7 +1,7 @@ -From 872e0a15a2b74cd6b6ba58e2e7e1605543ea36bd Mon Sep 17 00:00:00 2001 +From 483912c560424ee8b5cc996990d45802671fc73f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/30] On linux targets pass --as-needed by default to the +Subject: [PATCH 05/39] On linux targets pass --as-needed by default to the linker, but always link the sanitizer libraries with --no-as-needed. --- @@ -192,10 +192,10 @@ index 6919b468f06..56d52d41b31 100644 %{!shared: \ %{static:-static} \ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h -index 81201e67a2f..6477d7ec52e 100644 +index 63853e60c03..de6d8675456 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h -@@ -87,7 +87,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); +@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" #undef LINK_SPEC @@ -265,5 +265,5 @@ index 625c9ab7902..7aec9d3a016 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.27.0 +2.28.0 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 37ab133e9..01d7d7d29 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,7 +1,7 @@ -From 5e20872b8cc916cb457c63c6cd970c4fcba47bbb Mon Sep 17 00:00:00 2001 +From c57a8b43401ca9a1b889fa9fd421ac49c3dbd380 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/30] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH 06/39] Enable -Wformat and -Wformat-security by default. --- gcc/c-family/c.opt | 4 ++-- @@ -30,5 +30,5 @@ index c49da99d395..93f25319005 100644 Wformat-overflow= -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch index 31a7faa03..c2d64dff7 100644 --- a/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-armhf/0007-Enable-Wtrampolines-by-default.patch @@ -1,14 +1,14 @@ -From 1bcf7e30226852db956becebaffdfe2738923423 Mon Sep 17 00:00:00 2001 +From a58dad2c52639422671ac6986c36e48499fc2f20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/30] Enable -Wtrampolines by default. +Subject: [PATCH 07/39] Enable -Wtrampolines by default. --- gcc/common.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt -index d3c3e51dcb0..7b68397c232 100644 +index 8bb65e0e1af..ace932b300d 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning @@ -21,5 +21,5 @@ index d3c3e51dcb0..7b68397c232 100644 Wtype-limits -- -2.27.0 +2.28.0 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 index 0b3ce1a78..f7d30e3b0 100644 --- 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 @@ -1,7 +1,7 @@ -From 23fd86ff34670873dd294bd87b93f45c3624903a Mon Sep 17 00:00:00 2001 +From 98b2b8f7de60ed1b6b7602124ef6db278cf3c212 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/30] Disable ssp on -nostdlib, -nodefaultlibs and +Subject: [PATCH 08/39] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding Change the buffer size. --- @@ -49,5 +49,5 @@ index 4aec480798b..eaecfab37ad 100644 -param=stack-clash-protection-guard-size= -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index 0e059262e..f8f8eea78 100644 --- a/cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-armhf/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,7 +1,7 @@ -From d27d7936ecd9f357a3c6ee05e6548f8a68fdd4b7 Mon Sep 17 00:00:00 2001 +From 035775ef38206ed2859500efe5fb42ceec2e858d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/30] Ensure that msgfmt doesn't encounter problems during +Subject: [PATCH 09/39] Ensure that msgfmt doesn't encounter problems during gcc bootstrapping. Solves error messages like the following: @@ -50,5 +50,5 @@ index a0f84b0cfa0..ab24a47a2fd 100644 all-local: all-local-$(USE_NLS) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch index d85b7c593..49118500f 100644 --- a/cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-armhf/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,7 +1,7 @@ -From 2ec258d6d31e2c0c614c5086acee84a87768a67c Mon Sep 17 00:00:00 2001 +From e9875d74e75c601b95dba677bc9e58c869150212 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/30] Don't declare asprintf if defined as a macro. +Subject: [PATCH 10/39] Don't declare asprintf if defined as a macro. --- include/libiberty.h | 3 +++ @@ -24,5 +24,5 @@ index 141cb886a85..fa0e78eb62f 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch index 770cad546..6a1450675 100644 --- a/cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-armhf/0011-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,7 +1,7 @@ -From 4f6fd2272f57620da399d0f841fce12b9db3b2d1 Mon Sep 17 00:00:00 2001 +From 764e64bba73a7b7eb5154c8537781412252ed33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/30] libiberty: copy PIC objects during build process +Subject: [PATCH 11/39] libiberty: copy PIC objects during build process --- libiberty/Makefile.in | 1 + @@ -20,5 +20,5 @@ index d6b302e02fd..fd39928546f 100644 else true; fi -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0012-libitm-disable-FORTIFY.patch b/cross/gcc-armhf/0012-libitm-disable-FORTIFY.patch index 169361398..ba2e1fa9f 100644 --- a/cross/gcc-armhf/0012-libitm-disable-FORTIFY.patch +++ b/cross/gcc-armhf/0012-libitm-disable-FORTIFY.patch @@ -1,7 +1,7 @@ -From cef5e0336cfdf4afd0e01fa9e562f686b234697a Mon Sep 17 00:00:00 2001 +From da46d99b1b7661a98064a45bdccf08c1867582b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:36 +0000 -Subject: [PATCH 12/30] libitm: disable FORTIFY +Subject: [PATCH 12/39] libitm: disable FORTIFY --- libitm/configure.tgt | 10 ++++++++++ @@ -29,5 +29,5 @@ index 04109160e91..107b957ece3 100644 # work out any special compilation flags as necessary. case "${target_cpu}" in -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0013-libgcc_s.patch b/cross/gcc-armhf/0013-libgcc_s.patch index f04d7f7c0..d0636b2bc 100644 --- a/cross/gcc-armhf/0013-libgcc_s.patch +++ b/cross/gcc-armhf/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From d31721459e363e49dfe0a7797300864d9cef92f0 Mon Sep 17 00:00:00 2001 +From 354f2a8ceb70f9f6e1688ba41c1cc1c17ac87329 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 13/30] libgcc_s +Subject: [PATCH 13/39] libgcc_s --- gcc/config/i386/i386-expand.c | 4 ++-- @@ -10,10 +10,10 @@ Subject: [PATCH 13/30] libgcc_s 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c -index 6c759b01edf..8cf0e069e1c 100644 +index c6033688f51..a60e5162995 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c -@@ -10948,10 +10948,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -10966,10 +10966,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -53,5 +53,5 @@ index 8506a635790..564296f788e 100644 +HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) CRTSTUFF_T_CFLAGS += $(CET_FLAGS) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0014-nopie.patch b/cross/gcc-armhf/0014-nopie.patch index 086031937..ed8f503c8 100644 --- a/cross/gcc-armhf/0014-nopie.patch +++ b/cross/gcc-armhf/0014-nopie.patch @@ -1,7 +1,7 @@ -From f64f853eae3b390adbbc9b74a336d93918e6dca4 Mon Sep 17 00:00:00 2001 +From 7fb84007ff62309abffdbddfa751e69c331e82c3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 14/30] nopie +Subject: [PATCH 14/39] nopie --- gcc/configure | 27 +++++++++++++++++++++++++++ @@ -9,10 +9,10 @@ Subject: [PATCH 14/30] nopie 2 files changed, 40 insertions(+) diff --git a/gcc/configure b/gcc/configure -index 90e3be864f8..951a093b459 100755 +index 793530e21cf..2d874d3defe 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -30774,6 +30774,33 @@ fi +@@ -30779,6 +30779,33 @@ fi $as_echo "$gcc_cv_no_pie" >&6; } if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -47,10 +47,10 @@ index 90e3be864f8..951a093b459 100755 diff --git a/gcc/configure.ac b/gcc/configure.ac -index f42006e5476..fe392298016 100644 +index 0fd438e39e5..0b257e687ee 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6858,6 +6858,19 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -6863,6 +6863,19 @@ AC_CACHE_CHECK([for -no-pie option], LDFLAGS="$saved_LDFLAGS"]) if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -71,5 +71,5 @@ index f42006e5476..fe392298016 100644 AC_SUBST([NO_PIE_FLAG]) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch b/cross/gcc-armhf/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch index 8f007668f..b7bd1857f 100644 --- a/cross/gcc-armhf/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +++ b/cross/gcc-armhf/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch @@ -1,7 +1,7 @@ -From 37dace030c1402a8e6734a0fc59e18717ce1a2ef Mon Sep 17 00:00:00 2001 +From 3f764eb6dc371cc48cfdf231cbd40e64b1f2a671 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:57:09 +0000 -Subject: [PATCH 15/30] libffi: use __linux__ instead of __gnu_linux__ for musl +Subject: [PATCH 15/39] libffi: use __linux__ instead of __gnu_linux__ for musl --- libffi/src/closures.c | 2 +- @@ -21,5 +21,5 @@ index 721ff00ea43..22a699c6340 100644 with both write and execute permission. Code compiled when this option is defined will attempt to map such pages once, but if it -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0016-dlang-update-zlib-binding.patch b/cross/gcc-armhf/0016-dlang-update-zlib-binding.patch index 9204db8a8..b2dcb0eb1 100644 --- a/cross/gcc-armhf/0016-dlang-update-zlib-binding.patch +++ b/cross/gcc-armhf/0016-dlang-update-zlib-binding.patch @@ -1,7 +1,7 @@ -From 7fc386a2e629e859968da4eb4d0ff4983cb3b76f Mon Sep 17 00:00:00 2001 +From b78dea0f8f09d4092bec52b7ada719ead2552dd2 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:57:51 +0000 -Subject: [PATCH 16/30] dlang: update zlib binding +Subject: [PATCH 16/39] dlang: update zlib binding --- libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++----------- @@ -421,5 +421,5 @@ index e6cce240fd5..bd2fe37ebec 100644 } -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch b/cross/gcc-armhf/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch index 7b11d6bae..570c44c4b 100644 --- a/cross/gcc-armhf/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +++ b/cross/gcc-armhf/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch @@ -1,7 +1,7 @@ -From ef5f7880cff27a2b92952ce53a207d5dd896923b Mon Sep 17 00:00:00 2001 +From 58c529af8a9673b90dc7137065ab788c25b358a8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:58:22 +0000 -Subject: [PATCH 17/30] dlang: fix fcntl on mips, add libucontext dep +Subject: [PATCH 17/39] dlang: fix fcntl on mips, add libucontext dep --- libphobos/configure.tgt | 1 + @@ -47,5 +47,5 @@ index 9febcff849b..cb34e2108bd 100644 static assert(0, "Platform not supported"); -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0018-ada-fix-shared-linking.patch b/cross/gcc-armhf/0018-ada-fix-shared-linking.patch index 1fc9b372b..6486564c1 100644 --- a/cross/gcc-armhf/0018-ada-fix-shared-linking.patch +++ b/cross/gcc-armhf/0018-ada-fix-shared-linking.patch @@ -1,7 +1,7 @@ -From b675e0383262d6d702f5b732e4459d3e2c2a4891 Mon Sep 17 00:00:00 2001 +From 2a614f9b702b02c312cd513eddb1fc6745f9a3ad Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 18/30] ada: fix shared linking +Subject: [PATCH 18/39] ada: fix shared linking --- gcc/ada/link.c | 12 ++++++------ @@ -38,5 +38,5 @@ index 02c413a412f..f0e52a87d6e 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-armhf/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index 591f9ffa3..788c0fb9b 100644 --- a/cross/gcc-armhf/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-armhf/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,7 +1,7 @@ -From 0ea91dd6f8d856d5b589c2a3e95469fea06e7094 Mon Sep 17 00:00:00 2001 +From dab36b973223e0d6853f564e845bc22dadcc4d2d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 19/30] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH 19/39] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + @@ -20,5 +20,5 @@ index 36e369df6e7..63627db68cf 100644 # This is the list of directories to built for the host system. -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0020-libstdc-futex-add-time64-compatibility.patch b/cross/gcc-armhf/0020-libstdc-futex-add-time64-compatibility.patch index 73d7f0730..8d5f43888 100644 --- a/cross/gcc-armhf/0020-libstdc-futex-add-time64-compatibility.patch +++ b/cross/gcc-armhf/0020-libstdc-futex-add-time64-compatibility.patch @@ -1,7 +1,7 @@ -From 9684a815e1cbe854383c3c511e1d84d43c46ec94 Mon Sep 17 00:00:00 2001 +From c2efb7703c2ef381a8b1d1cd751222e0a7e10665 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:00:17 +0000 -Subject: [PATCH 20/30] libstdc++: futex: add time64 compatibility +Subject: [PATCH 20/39] libstdc++: futex: add time64 compatibility --- libstdc++-v3/src/c++11/futex.cc | 8 ++++++++ @@ -28,5 +28,5 @@ index c9de11a7ec7..7be702dbeda 100644 rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; if (rt.tv_nsec < 0) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0021-add-fortify-headers-paths.patch b/cross/gcc-armhf/0021-add-fortify-headers-paths.patch index 81e26a47e..0d14a614b 100644 --- a/cross/gcc-armhf/0021-add-fortify-headers-paths.patch +++ b/cross/gcc-armhf/0021-add-fortify-headers-paths.patch @@ -1,7 +1,7 @@ -From a0708ec975c01b049d254dc51179898966bf8a52 Mon Sep 17 00:00:00 2001 +From ca8a8331acef15d0b3b095b8c63539acd1d93e8b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 21/30] add fortify-headers paths +Subject: [PATCH 21/39] add fortify-headers paths --- gcc/config/linux.h | 2 ++ @@ -21,5 +21,5 @@ index 95654bcdb5a..d88df8f154a 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-armhf/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index a93b372e9..5f1ae3c8c 100644 --- a/cross/gcc-armhf/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-armhf/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,7 +1,7 @@ -From 740342a0e4b0b3af498964440918abba1a27ba33 Mon Sep 17 00:00:00 2001 +From 23468db70f830e99ac138826d28cc33fa71d3405 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 22/30] Alpine musl package provides libssp_nonshared.a. We +Subject: [PATCH 22/39] 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 @@ -27,5 +27,5 @@ index daeb4d0c8ea..6920bec0fa0 100644 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-armhf/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index 4717d7416..8d0e39ba5 100644 --- a/cross/gcc-armhf/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-armhf/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,7 +1,7 @@ -From 775adf35d6f34f61947fc28a2bdbfa7e881c40d5 Mon Sep 17 00:00:00 2001 +From 67513cb76a43014172f54384c3bad0c41e949c8a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 23/30] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH 23/39] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- @@ -65,5 +65,5 @@ index 6920bec0fa0..40e07354b3d 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0024-Pure-64-bit-MIPS.patch b/cross/gcc-armhf/0024-Pure-64-bit-MIPS.patch index 95cefb3dd..55021c8f8 100644 --- a/cross/gcc-armhf/0024-Pure-64-bit-MIPS.patch +++ b/cross/gcc-armhf/0024-Pure-64-bit-MIPS.patch @@ -1,7 +1,7 @@ -From 717090cf538f765db1730956c512a43f2d52a802 Mon Sep 17 00:00:00 2001 +From 5d9d38da4f523c052a5bcd2562d79809b4136f2c Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Thu, 21 Dec 2017 03:14:33 +0100 -Subject: [PATCH 24/30] Pure 64-bit MIPS +Subject: [PATCH 24/39] Pure 64-bit MIPS --- gcc/config/mips/mips.h | 8 ++++---- @@ -43,5 +43,5 @@ index ceb58d3b5f3..8116e23ebba 100644 + ../lib32 \ + ../lib -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0025-use-pure-64-bit-configuration-where-appropriate.patch b/cross/gcc-armhf/0025-use-pure-64-bit-configuration-where-appropriate.patch index 8e2db4831..2c2d3030b 100644 --- a/cross/gcc-armhf/0025-use-pure-64-bit-configuration-where-appropriate.patch +++ b/cross/gcc-armhf/0025-use-pure-64-bit-configuration-where-appropriate.patch @@ -1,7 +1,7 @@ -From f73cf8d2f8f4eee71fc2ba850672e69f509a4486 Mon Sep 17 00:00:00 2001 +From ac0eeb3237ac2cf75c19be92afe3335c9a0d83bb Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:04:40 +0000 -Subject: [PATCH 25/30] use pure 64-bit configuration where appropriate +Subject: [PATCH 25/39] use pure 64-bit configuration where appropriate --- gcc/config/aarch64/t-aarch64-linux | 2 +- @@ -117,5 +117,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0026-always-build-libgcc_eh.a.patch b/cross/gcc-armhf/0026-always-build-libgcc_eh.a.patch index b41f8e9ed..d89d12b8c 100644 --- a/cross/gcc-armhf/0026-always-build-libgcc_eh.a.patch +++ b/cross/gcc-armhf/0026-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From 8472f6d0037dcd19c44b1e95d95fbf937b3823e6 Mon Sep 17 00:00:00 2001 +From 3f35cf750117fa7cbceaf33e4bea008d0688bd93 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 26/30] always build libgcc_eh.a +Subject: [PATCH 26/39] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -47,5 +47,5 @@ index 851e7657d07..99ec513a1a6 100644 for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0027-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-armhf/0027-ada-libgnarl-compatibility-for-musl.patch index f44caa24c..15b17fbbd 100644 --- a/cross/gcc-armhf/0027-ada-libgnarl-compatibility-for-musl.patch +++ b/cross/gcc-armhf/0027-ada-libgnarl-compatibility-for-musl.patch @@ -1,7 +1,7 @@ -From 4e1b3a26f558e7693853d3600ee677705e67406c Mon Sep 17 00:00:00 2001 +From 48342d154084bb9610b8f02f93fcfc2aa606595a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 27/30] ada: libgnarl compatibility for musl +Subject: [PATCH 27/39] ada: libgnarl compatibility for musl --- gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ @@ -131,5 +131,5 @@ index c45559e5ba0..0b0f173e7d4 100644 pragma Assert (Result in 0 | ENOMEM); -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0028-ada-musl-support-fixes.patch b/cross/gcc-armhf/0028-ada-musl-support-fixes.patch index 8eb13422c..b776c58c5 100644 --- a/cross/gcc-armhf/0028-ada-musl-support-fixes.patch +++ b/cross/gcc-armhf/0028-ada-musl-support-fixes.patch @@ -1,7 +1,7 @@ -From 5e3d7d2f1e2448b6c5eb207f9251c437629e43bc Mon Sep 17 00:00:00 2001 +From 0d517a7c90f9e21616c8ad0c66e24c1554f6658c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 28/30] ada: musl support fixes +Subject: [PATCH 28/39] ada: musl support fixes --- gcc/ada/Makefile.rtl | 10 +++++----- @@ -219,5 +219,5 @@ index af4417fab90..bab6bf3ca87 100644 status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); #elif defined (USE_CLONE_DEVICE) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armhf/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch b/cross/gcc-armhf/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch deleted file mode 100644 index 13500dafe..000000000 --- a/cross/gcc-armhf/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch +++ /dev/null @@ -1,520 +0,0 @@ -From d6599f89ba558ec2a68d4bc4af15cf3513218054 Mon Sep 17 00:00:00 2001 -From: Richard Sandiford -Date: Mon, 3 Aug 2020 09:48:36 +0100 -Subject: [PATCH 29/30] c: Fix bogus vector initialisation error [PR96377] - -One of the problems in this PR was that if we had: - - vector_type1 array[] = { vector_value1 }; - -process_init_element would only treat vector_value1 as initialising -a vector_type1 if they had the same TYPE_MAIN_VARIANT. This has -several problems: - -(1) It gives confusing error messages if the vector types are - incompatible. (Tested by gcc.dg/pr96377-1.c.) - -(2) It means that we reject code that should be valid with - -flax-vector-conversions. (Tested by gcc.dg/pr96377-2.c.) - -(3) On arm and aarch64 targets, it means that we reject some - initializers that mix Advanced SIMD and standard GNU vectors. - These vectors have traditionally had different TYPE_MAIN_VARIANTs - because they have different mangling schemes. (Tested by - gcc.dg/pr96377-[3-6].c.) - -(4) It means that we reject SVE initializers that should be valid. - (Tested by gcc.target/aarch64/sve/gnu_vectors_[34].c.) - -(5) After r11-1741-g:31427b974ed7b7dd54e2 we reject: - - arm_neon_type1 array[] = { k ^ arm_neon_value1 }; - - because applying the binary operator to arm_neon_value1 strips - the "Advanced SIMD type" attributes that were added in that patch. - Stripping the attributes is problematic for other reasons though, - so that still needs to be fixed separately. - -g++.target/aarch64/sve/gnu_vectors_[34].C already pass. - -gcc/c/ - PR c/96377 - * c-typeck.c (process_init_element): Split test for whether to - recurse into a record, union or array into... - (initialize_elementwise_p): ...this new function. Don't recurse - into a vector type if the initialization value is also a vector. - -gcc/testsuite/ - PR c/96377 - * gcc.dg/pr96377-1.c: New test. - * gcc.dg/pr96377-2.c: Likewise. - * gcc.dg/pr96377-3.c: Likewise. - * gcc.dg/pr96377-4.c: Likewise. - * gcc.dg/pr96377-5.c: Likewise. - * gcc.dg/pr96377-6.c: Likewise. - * gcc.target/aarch64/pr96377-1.c: Likewise. - * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c: Likewise. - * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c: Likewise. - * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C: Likewise. - * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C: Likewise. - -(cherry picked from commit 7d599ad27b9bcf5165f87710f1abc64bbabd06ae) ---- - gcc/c/c-typeck.c | 59 ++++++++++++++----- - .../sve/acle/general-c++/gnu_vectors_3.C | 15 +++++ - .../sve/acle/general-c++/gnu_vectors_4.C | 15 +++++ - gcc/testsuite/gcc.dg/pr96377-1.c | 32 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-2.c | 31 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-3.c | 33 +++++++++++ - gcc/testsuite/gcc.dg/pr96377-4.c | 32 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-5.c | 33 +++++++++++ - gcc/testsuite/gcc.dg/pr96377-6.c | 32 ++++++++++ - gcc/testsuite/gcc.target/aarch64/pr96377-1.c | 20 +++++++ - .../sve/acle/general-c/gnu_vectors_3.c | 15 +++++ - .../sve/acle/general-c/gnu_vectors_4.c | 15 +++++ - 12 files changed, 317 insertions(+), 15 deletions(-) - create mode 100644 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C - create mode 100644 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C - create mode 100644 gcc/testsuite/gcc.dg/pr96377-1.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-2.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-3.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-4.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-5.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-6.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/pr96377-1.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c - -diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c -index eb4b641e6bb..58762f10a93 100644 ---- a/gcc/c/c-typeck.c -+++ b/gcc/c/c-typeck.c -@@ -9910,6 +9910,47 @@ output_pending_init_elements (int all, struct obstack * braced_init_obstack) - goto retry; - } - -+/* Expression VALUE coincides with the start of type TYPE in a braced -+ initializer. Return true if we should treat VALUE as initializing -+ the first element of TYPE, false if we should treat it as initializing -+ TYPE as a whole. -+ -+ If the initializer is clearly invalid, the question becomes: -+ which choice gives the best error message? */ -+ -+static bool -+initialize_elementwise_p (tree type, tree value) -+{ -+ if (type == error_mark_node || value == error_mark_node) -+ return false; -+ -+ gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type); -+ -+ tree value_type = TREE_TYPE (value); -+ if (value_type == error_mark_node) -+ return false; -+ -+ /* GNU vectors can be initialized elementwise. However, treat any -+ kind of vector value as initializing the vector type as a whole, -+ regardless of whether the value is a GNU vector. Such initializers -+ are valid if and only if they would have been valid in a non-braced -+ initializer like: -+ -+ TYPE foo = VALUE; -+ -+ so recursing into the vector type would be at best confusing or at -+ worst wrong. For example, when -flax-vector-conversions is in effect, -+ it's possible to initialize a V8HI from a V4SI, even though the vectors -+ have different element types and different numbers of elements. */ -+ if (gnu_vector_type_p (type)) -+ return !VECTOR_TYPE_P (value_type); -+ -+ if (AGGREGATE_TYPE_P (type)) -+ return type != TYPE_MAIN_VARIANT (value_type); -+ -+ return false; -+} -+ - /* Add one non-braced element to the current constructor level. - This adjusts the current position within the constructor's type. - This may also start or terminate implicit levels -@@ -10089,11 +10130,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype -- && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE -- || fieldcode == UNION_TYPE -- || gnu_vector_type_p (fieldtype))) -+ && initialize_elementwise_p (fieldtype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -@@ -10181,11 +10218,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype -- && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE -- || fieldcode == UNION_TYPE -- || gnu_vector_type_p (fieldtype))) -+ && initialize_elementwise_p (fieldtype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -@@ -10224,11 +10257,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != elttype -- && (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE -- || eltcode == UNION_TYPE -- || gnu_vector_type_p (elttype))) -+ && initialize_elementwise_p (elttype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C -new file mode 100644 -index 00000000000..e607d58d726 ---- /dev/null -+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "cannot convert" } -+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "cannot convert" } -+} -diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C -new file mode 100644 -index 00000000000..ac4e0d12ff8 ---- /dev/null -+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; -+ gnu_uint8_t arr3[] = { sve_s1 }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-1.c b/gcc/testsuite/gcc.dg/pr96377-1.c -new file mode 100644 -index 00000000000..2bf3f816331 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-1.c -@@ -0,0 +1,32 @@ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-2.c b/gcc/testsuite/gcc.dg/pr96377-2.c -new file mode 100644 -index 00000000000..f58b06d9076 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-2.c -@@ -0,0 +1,31 @@ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-3.c b/gcc/testsuite/gcc.dg/pr96377-3.c -new file mode 100644 -index 00000000000..66dce01f277 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-3.c -@@ -0,0 +1,33 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (__Int32x4_t i, __Int16x8_t h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-4.c b/gcc/testsuite/gcc.dg/pr96377-4.c -new file mode 100644 -index 00000000000..f7aaf490031 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-4.c -@@ -0,0 +1,32 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (__Int32x4_t i, __Int16x8_t h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-5.c b/gcc/testsuite/gcc.dg/pr96377-5.c -new file mode 100644 -index 00000000000..3d0c24befa6 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-5.c -@@ -0,0 +1,33 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { __Int16x8_t x; __Int32x4_t y; }; -+union u1 { __Int16x8_t x; __Int32x4_t y; }; -+union u2 { __Int32x4_t s; __Int16x8_t y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__Int16x8_t" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-6.c b/gcc/testsuite/gcc.dg/pr96377-6.c -new file mode 100644 -index 00000000000..165327fa292 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-6.c -@@ -0,0 +1,32 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { __Int16x8_t x; __Int32x4_t y; }; -+union u1 { __Int16x8_t x; __Int32x4_t y; }; -+union u2 { __Int32x4_t s; __Int16x8_t y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/pr96377-1.c b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c -new file mode 100644 -index 00000000000..51e3e36edfc ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c -@@ -0,0 +1,20 @@ -+/* { dg-options "" } */ -+ -+#include -+ -+struct aegis128_state { -+ uint8x16_t v[5]; -+}; -+ -+void foo(const void *key, const void *iv, const void *const0, const void *const1) -+{ -+ uint8x16_t k = vld1q_u8(key); -+ uint8x16_t kiv = k ^ vld1q_u8(iv); -+ struct aegis128_state st = {{ -+ kiv, -+ vld1q_u8(const1), -+ vld1q_u8(const0), -+ k ^ vld1q_u8(const0), -+ k ^ vld1q_u8(const1), -+ }}; -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c -new file mode 100644 -index 00000000000..0f1a2b0e46b ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "incompatible types" } -+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "incompatible types" } -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c -new file mode 100644 -index 00000000000..ac4e0d12ff8 ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; -+ gnu_uint8_t arr3[] = { sve_s1 }; -+} --- -2.27.0 - diff --git a/cross/gcc-armv7/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch b/cross/gcc-armhf/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch similarity index 92% rename from cross/gcc-armv7/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch rename to cross/gcc-armhf/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch index 6c1eb03b9..25bb335d0 100644 --- a/cross/gcc-armv7/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +++ b/cross/gcc-armhf/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch @@ -1,7 +1,7 @@ -From 756d3163d2ee3ee21ad815ab6dfebe58e8c32965 Mon Sep 17 00:00:00 2001 +From 3d86ab883c2a67dc9828f73a3d84c9fdb202ec32 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:58:08 +0200 -Subject: [PATCH] gcc-go: Use _off_t type instead of _loff_t +Subject: [PATCH 29/39] gcc-go: Use _off_t type instead of _loff_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -43,3 +43,6 @@ index 88286c07b6e..f8f5cfb5011 100644 plwoff = &lwoff } n, err = splice(rfd, plroff, wfd, plwoff, len, flags) +-- +2.28.0 + diff --git a/cross/gcc-armhf/0032-gcc-go-Don-t-include-sys-user.h.patch b/cross/gcc-armhf/0030-gcc-go-Don-t-include-sys-user.h.patch similarity index 82% rename from cross/gcc-armhf/0032-gcc-go-Don-t-include-sys-user.h.patch rename to cross/gcc-armhf/0030-gcc-go-Don-t-include-sys-user.h.patch index 897dd6ec3..8150bebb1 100644 --- a/cross/gcc-armhf/0032-gcc-go-Don-t-include-sys-user.h.patch +++ b/cross/gcc-armhf/0030-gcc-go-Don-t-include-sys-user.h.patch @@ -1,7 +1,7 @@ -From ba9db3417c93a42dbf994e7c18c021f5542aa354 Mon Sep 17 00:00:00 2001 +From da63b5262701f91a2261812332f2850be0180634 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:58:21 +0200 -Subject: [PATCH] gcc-go: Don't include sys/user.h +Subject: [PATCH 30/39] gcc-go: Don't include sys/user.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -25,3 +25,6 @@ index 0692fd41eb7..c8d987358d9 100644 #if defined(HAVE_SYS_UTSNAME_H) #include #endif +-- +2.28.0 + diff --git a/cross/gcc-armhf/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch b/cross/gcc-armhf/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch deleted file mode 100644 index 8543681f6..000000000 --- a/cross/gcc-armhf/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 773021143288f5bf0dca1e3ee1f908f580f6fd9c Mon Sep 17 00:00:00 2001 -From: Peter Bergner -Date: Thu, 13 Aug 2020 13:40:39 -0500 -Subject: [PATCH 30/30] rs6000: ICE when using an MMA type as a function param - or return value [PR96506] - -PR96506 shows a problem where we ICE on illegal usage, namely using MMA -types for function arguments and return values. The solution is to flag -these illegal usages as errors early, before we ICE. - -2020-08-13 Peter Bergner - -gcc/ - PR target/96506 - * config/rs6000/rs6000-call.c (rs6000_promote_function_mode): Disallow - MMA types as return values. - (rs6000_function_arg): Disallow MMA types as function arguments. - -gcc/testsuite/ - PR target/96506 - * gcc.target/powerpc/pr96506.c: New test. - -(cherry picked from commit 0ad7e730c142ef6cd0ddc1491a89a7f330caa887) ---- - gcc/config/rs6000/rs6000-call.c | 34 ++++++++++- - gcc/testsuite/gcc.target/powerpc/pr96506.c | 66 ++++++++++++++++++++++ - 2 files changed, 99 insertions(+), 1 deletion(-) - create mode 100644 gcc/testsuite/gcc.target/powerpc/pr96506.c - -diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c -index 243601e90c1..37566780e54 100644 ---- a/gcc/config/rs6000/rs6000-call.c -+++ b/gcc/config/rs6000/rs6000-call.c -@@ -6076,8 +6076,30 @@ machine_mode - rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, - machine_mode mode, - int *punsignedp ATTRIBUTE_UNUSED, -- const_tree, int) -+ const_tree, int for_return) - { -+ /* Warning: this is a static local variable and not always NULL! -+ This function is called multiple times for the same function -+ and return value. PREV_FUNC is used to keep track of the -+ first time we encounter a function's return value in order -+ to not report an error with that return value multiple times. */ -+ static struct function *prev_func = NULL; -+ -+ /* We do not allow MMA types being used as return values. Only report -+ the invalid return value usage the first time we encounter it. */ -+ if (for_return -+ && prev_func != cfun -+ && (mode == POImode || mode == PXImode)) -+ { -+ /* Record we have now handled function CFUN, so the next time we -+ are called, we do not re-report the same error. */ -+ prev_func = cfun; -+ if (TYPE_CANONICAL (type) != NULL_TREE) -+ type = TYPE_CANONICAL (type); -+ error ("invalid use of MMA type %qs as a function return value", -+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); -+ } -+ - PROMOTE_MODE (mode, *punsignedp, type); - - return mode; -@@ -7028,6 +7050,16 @@ rs6000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) - machine_mode elt_mode; - int n_elts; - -+ /* We do not allow MMA types being used as function arguments. */ -+ if (mode == POImode || mode == PXImode) -+ { -+ if (TYPE_CANONICAL (type) != NULL_TREE) -+ type = TYPE_CANONICAL (type); -+ error ("invalid use of MMA operand of type %qs as a function parameter", -+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); -+ return NULL_RTX; -+ } -+ - /* Return a marker to indicate whether CR1 needs to set or clear the - bit that V.4 uses to say fp args were passed in registers. - Assume that we don't need the marker for software floating point, -diff --git a/gcc/testsuite/gcc.target/powerpc/pr96506.c b/gcc/testsuite/gcc.target/powerpc/pr96506.c -new file mode 100644 -index 00000000000..b1b40c5a5c8 ---- /dev/null -+++ b/gcc/testsuite/gcc.target/powerpc/pr96506.c -@@ -0,0 +1,66 @@ -+/* PR target/96506 */ -+/* { dg-do compile } */ -+/* { dg-require-effective-target power10_ok } */ -+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */ -+ -+extern void bar0(); -+extern void bar1(); -+extern void bar2(); -+extern void bar3(); -+ -+typedef __vector_pair vpair_t; -+typedef __vector_quad vquad_t; -+ -+/* Verify we flag errors on the following. */ -+ -+void -+foo0 (void) -+{ -+ __vector_pair v; -+ bar0 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */ -+} -+ -+void -+foo1 (void) -+{ -+ vpair_t v; -+ bar1 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */ -+} -+ -+void -+foo2 (void) -+{ -+ __vector_quad v; -+ bar2 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */ -+} -+ -+void -+foo3 (void) -+{ -+ vquad_t v; -+ bar3 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */ -+} -+ -+__vector_pair -+foo4 (__vector_pair *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */ -+{ -+ return *src; -+} -+ -+vpair_t -+foo5 (vpair_t *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */ -+{ -+ return *src; -+} -+ -+__vector_quad -+foo6 (__vector_quad *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */ -+{ -+ return *src; -+} -+ -+vquad_t -+foo7 (vquad_t *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */ -+{ -+ return *src; -+} --- -2.27.0 - diff --git a/cross/gcc-armv7/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch b/cross/gcc-armhf/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch similarity index 88% rename from cross/gcc-armv7/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch rename to cross/gcc-armhf/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch index 4584a3595..186e2d11b 100644 --- a/cross/gcc-armv7/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch +++ b/cross/gcc-armhf/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch @@ -1,7 +1,7 @@ -From a2da9c892a6b29a8067f20fda2d8a5e9a7b5193e Mon Sep 17 00:00:00 2001 +From 18d6d2d1f62a4232340696fb7d68d248c751e416 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:59:22 +0200 -Subject: [PATCH] gcc-go: Fix ucontext_t on PPC64 +Subject: [PATCH 31/39] gcc-go: Fix ucontext_t on PPC64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,3 +24,6 @@ index b429fdb2403..fd1c885f043 100644 #elif defined(__PPC__) && defined(_AIX) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; #elif defined(__aarch64__) && defined(__linux__) +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch b/cross/gcc-armhf/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch similarity index 92% rename from cross/gcc-aarch64/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch rename to cross/gcc-armhf/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch index 528bbb3c2..2ecd0ca01 100644 --- a/cross/gcc-aarch64/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch +++ b/cross/gcc-armhf/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch @@ -1,7 +1,7 @@ -From 1d0cd9bbbef7d1bd3f42ad493db8d08b539cba60 Mon Sep 17 00:00:00 2001 +From d9942a2e54f69dee9c03e5e4339a6c62473e6845 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:59:45 +0200 -Subject: [PATCH] gcc-go: Fix handling of signal 34 on musl +Subject: [PATCH 32/39] gcc-go: Fix handling of signal 34 on musl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -38,3 +38,6 @@ index 11e4ec436bd..fe866eacb27 100644 fi if test "${GOOS}" = "aix"; then +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch b/cross/gcc-armhf/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch similarity index 88% rename from cross/gcc-aarch64/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch rename to cross/gcc-armhf/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch index 683242458..2234e32e5 100644 --- a/cross/gcc-aarch64/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +++ b/cross/gcc-armhf/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch @@ -1,7 +1,7 @@ -From 956c8cc94e7aa487eb142905c319487d94dc621d Mon Sep 17 00:00:00 2001 +From 38e7c12086acae4507f9d5067f947431a28c34db Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:01:03 +0200 -Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap +Subject: [PATCH 33/39] gcc-go: Use int64 type as offset argument for mmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -33,3 +33,6 @@ index ba38ebaa9ab..3c9e5ce9461 100644 p := sysMmap(addr, n, prot, flags, fd, off) if uintptr(p) == _MAP_FAILED { return nil, errno() +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch b/cross/gcc-armhf/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch similarity index 88% rename from cross/gcc-aarch64/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch rename to cross/gcc-armhf/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch index aa6849135..40c515ee8 100644 --- a/cross/gcc-aarch64/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +++ b/cross/gcc-armhf/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch @@ -1,7 +1,8 @@ -From c3a80843b7502ec2bfb5f1e5b514658c5f9dd884 Mon Sep 17 00:00:00 2001 +From a4e800081081b00539bbb6fd8b5cf6b66504cfaa Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:02:28 +0200 -Subject: [PATCH] gcc-go: Fix st_{a,m,c}tim fields in generated sysinfo.go +Subject: [PATCH 34/39] gcc-go: Fix st_{a,m,c}tim fields in generated + sysinfo.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -32,3 +33,6 @@ index bd2ba32cba1..972e2c379bc 100755 -e 's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g' \ -e 's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g' \ -e 's/\([^a-zA-Z0-9_]\)_st_timespec_t\([^a-zA-Z0-9_]\)/\1StTimespec\2/g' \ +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0037-gcc-go-signal-34-is-special-on-musl-libc.patch b/cross/gcc-armhf/0035-gcc-go-signal-34-is-special-on-musl-libc.patch similarity index 85% rename from cross/gcc-aarch64/0037-gcc-go-signal-34-is-special-on-musl-libc.patch rename to cross/gcc-armhf/0035-gcc-go-signal-34-is-special-on-musl-libc.patch index 89228cf8b..f4046862d 100644 --- a/cross/gcc-aarch64/0037-gcc-go-signal-34-is-special-on-musl-libc.patch +++ b/cross/gcc-armhf/0035-gcc-go-signal-34-is-special-on-musl-libc.patch @@ -1,7 +1,7 @@ -From 75e274b0819c9a77ca121113301d353f7aa91740 Mon Sep 17 00:00:00 2001 +From 57ccf0ad7f0c4b1f998ebfb6cdaa7d1876012d66 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:03:03 +0200 -Subject: [PATCH] gcc-go: signal 34 is special on musl libc +Subject: [PATCH 35/39] gcc-go: signal 34 is special on musl libc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,3 +24,6 @@ index c555712a03c..9e228580d37 100644 return _SIG_DFL } throw("sigaction read failure") +-- +2.28.0 + diff --git a/cross/gcc-armhf/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch b/cross/gcc-armhf/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch similarity index 85% rename from cross/gcc-armhf/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch rename to cross/gcc-armhf/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch index 3c21fedaf..08d9ca397 100644 --- a/cross/gcc-armhf/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch +++ b/cross/gcc-armhf/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch @@ -1,7 +1,7 @@ -From ff096af4402ab87a61eb3979b47246a3a1b4fa38 Mon Sep 17 00:00:00 2001 +From e6d4cdd4d03cceb01e8ed03bbe7d35b5798abc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 30 Aug 2020 19:26:53 +0200 -Subject: [PATCH] gcc-go: Prefer _off_t over _off64_t +Subject: [PATCH 36/39] gcc-go: Prefer _off_t over _off64_t musl does not seem to have _off64_t. --- @@ -25,3 +25,6 @@ index 972e2c379bc..8d6da15f983 100755 echo "type Mode_t _mode_t" >> ${OUT} echo "type Pid_t _pid_t" >> ${OUT} echo "type Uid_t _uid_t" >> ${OUT} +-- +2.28.0 + diff --git a/cross/gcc-armhf/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch b/cross/gcc-armhf/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch similarity index 81% rename from cross/gcc-armhf/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch rename to cross/gcc-armhf/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch index 30995e582..c5e4806fe 100644 --- a/cross/gcc-armhf/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +++ b/cross/gcc-armhf/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch @@ -1,7 +1,7 @@ -From 56dc7cac03987e95915032161ff0f7d5a8b8bf36 Mon Sep 17 00:00:00 2001 +From ac54a2afa01a3ebb06346f8dac505f0babbbe1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 30 Aug 2020 19:27:51 +0200 -Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c +Subject: [PATCH 37/39] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c --- libgo/runtime/proc.c | 4 ++++ @@ -22,3 +22,6 @@ index 274ce01c0bf..92a540bdde9 100644 #ifndef SETCONTEXT_CLOBBERS_TLS static inline void +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0040-gcc-go-link-to-libucontext.patch b/cross/gcc-armhf/0038-gcc-go-link-to-libucontext.patch similarity index 83% rename from cross/gcc-aarch64/0040-gcc-go-link-to-libucontext.patch rename to cross/gcc-armhf/0038-gcc-go-link-to-libucontext.patch index de59e07f6..5a626f601 100644 --- a/cross/gcc-aarch64/0040-gcc-go-link-to-libucontext.patch +++ b/cross/gcc-armhf/0038-gcc-go-link-to-libucontext.patch @@ -1,7 +1,7 @@ -From ead76eced040b588f9374646a188ba21abab2049 Mon Sep 17 00:00:00 2001 +From e456a63af7f0bd1f519de98e74f864be0f73572a Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 31 Aug 2020 08:59:40 +0200 -Subject: [PATCH] gcc-go: link to libucontext +Subject: [PATCH 38/39] gcc-go: link to libucontext --- Makefile.in | 2 +- @@ -20,3 +20,6 @@ index 63627db68cf..c7f1f84d683 100644 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch b/cross/gcc-armhf/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch similarity index 83% rename from cross/gcc-aarch64/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch rename to cross/gcc-armhf/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch index 406a74d00..b3568a511 100644 --- a/cross/gcc-aarch64/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch +++ b/cross/gcc-armhf/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch @@ -1,7 +1,8 @@ -From 3f5ee6a593215fbd40975d801ff37cf81a3fced3 Mon Sep 17 00:00:00 2001 +From f3a1e98d6d4d546bfb749b91c1f3639df905c1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 31 Aug 2020 20:26:56 +0200 -Subject: [PATCH] gcc-go: Disable printing of unaccessible ppc64 struct members +Subject: [PATCH 39/39] gcc-go: Disable printing of unaccessible ppc64 struct + members These struct members do not seem to exist on musl. --- @@ -21,3 +22,6 @@ index fd1c885f043..e845e453332 100644 { mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; int i; +-- +2.28.0 + diff --git a/cross/gcc-armhf/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch b/cross/gcc-armhf/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch deleted file mode 100644 index a3087c678..000000000 --- a/cross/gcc-armhf/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 27a633f79c9a0248ce673ff2d9c397e136427b01 Mon Sep 17 00:00:00 2001 -From: None <@> -Date: Wed, 21 Oct 2020 17:35:50 +0000 -Subject: Backport of patch of the GCC 11 to avoid the GNU Attributes into - libgcc - -source: https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554770.html - -The -mno-gnu-attribute avoids the linker emit an error when check -the type of long double 128bit. - -Signed-off-by: Gustavo L F Walbon -Signed-off-by: Tulio Magno Quites Machado Filho ---- - main/gcc/t-float128 | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 -index d5413445..b4e1afab 100644 ---- a/libgcc/config/rs6000/t-float128 -+++ b/libgcc/config/rs6000/t-float128 -@@ -69,6 +69,17 @@ $(fp128_ppc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW) - $(fp128_obj) : $(fp128_includes) - $(fp128_obj) : $(srcdir)/config/rs6000/quad-float128.h - -+# If we are switching the default long double type, we need to use -+# -mno-gnu-attribute so that the __ibm128 support functions don't signal a -+# linker error since the default long double is now IEEE 128-bit instead of IBM -+# 128-bit. -+ibm-ldouble$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute -+ -+CFLAGS_TF_DECIMAL = -mno-gnu-attribute -Wno-psabi -mabi=ibmlongdouble -+CFLAGS_KF_DECIMAL = -mno-gnu-attribute -Wno-psabi -mabi=ieeelongdouble -+CFLAGS_KF_DECIMAL_SW = $(CFLAGS_KF_DECIMAL) -mno-float128-hardware -+$(TF_DECIMAL_OBJS) : INTERNAL_CFLAGS += $(CFLAGS_TF_DECIMAL) -+ - $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep) - @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \ - echo "Create $@"; \ --- -2.29.0 - diff --git a/cross/gcc-armhf/APKBUILD b/cross/gcc-armhf/APKBUILD index 76b637dec..1ecdc1a26 100644 --- a/cross/gcc-armhf/APKBUILD +++ b/cross/gcc-armhf/APKBUILD @@ -24,13 +24,14 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-armhf -pkgver=10.2.0 +_pkgbase=10.2.1 +pkgver=10.2.1_pre0 [ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2" [ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-armhf -pkgrel=7 +pkgrel=0 pkgdesc="Stage2 cross-compiler for armhf" url="https://gcc.gnu.org" arch="x86_64" @@ -169,7 +170,11 @@ if $LANG_ADA; then fi makedepends="$makedepends_build $makedepends_host" -source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# when using upstream releases, use this URI template +# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# +# right now, we are using a git snapshot +source="https://dev.alpinelinux.org/~nenolod/gcc-10.2.1.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -198,28 +203,25 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg 0026-always-build-libgcc_eh.a.patch 0027-ada-libgnarl-compatibility-for-musl.patch 0028-ada-musl-support-fixes.patch - 0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch - 0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch - 0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch - 0032-gcc-go-Don-t-include-sys-user.h.patch - 0033-gcc-go-Fix-ucontext_t-on-PPC64.patch - 0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch - 0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch - 0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch - 0037-gcc-go-signal-34-is-special-on-musl-libc.patch - 0038-gcc-go-Prefer-_off_t-over-_off64_t.patch - 0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch - 0040-gcc-go-link-to-libucontext.patch - 0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch - 0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch + 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch + 0030-gcc-go-Don-t-include-sys-user.h.patch + 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch + 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch + 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch + 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch + 0035-gcc-go-signal-34-is-special-on-musl-libc.patch + 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch + 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch + 0038-gcc-go-link-to-libucontext.patch + 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch " # gcc-4.8-build-args.patch # we build out-of-tree _gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver} -_gcclibdir="/usr/lib/gcc/$CTARGET/$pkgver" -_gcclibexec="/usr/libexec/gcc/$CTARGET/$pkgver" +_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}" +_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}" prepare() { cd "$_gccdir" @@ -242,7 +244,7 @@ prepare() { return 1 fi - echo ${pkgver} > gcc/BASE-VER + echo ${_pkgbase:-$pkgver} > gcc/BASE-VER } build() { @@ -648,46 +650,43 @@ gnat() { mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/ } -sha512sums="42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e gcc-10.2.0.tar.xz -ee2d344e912ebaddf71d53ff674ca7ea7837ee65f982a8f088339fd05261e441aace6087f7f936d32b502bff7e375094f48cb90562ab7734c57e1750d3fe2029 0001-posix_memalign.patch -deaf3ba25614df18b2b9b04244bcc9278c16d98f6fdeac17f7e2c0567be7c2836ab6d21fc9d8f779c672022d25fc278327d6d0d637bc200fadbb8d913ef95581 0002-gcc-poison-system-directories.patch -eb80ea94e008e33b97c8c0d47e74d639897a13357abbd130e9bff4ae30349b8f788acbaf4caa61f23022a86841c431b8bb639c536aab548dc735470a7c7ccfcf 0003-Turn-on-Wl-z-relro-z-now-by-default.patch -6cbc39dd24f7b4316b6e69940bf7c9f3ae889e8156f9c7dd72c8335e55a2a44d6fade37954296451b588bf8fc065514d4916ad527042b8f9a86d6e0d706e3c9c 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e8c75aef864e5852fc78bfd7949232fc58b40a743d7c04a122ee6e021ee99f72edcff6efbf74e0eedc9405faf81d01208867b0571c4dc8cb44b9a03d1d25fbde 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -d5b3d40e1c4828d16684137487f64bf0b4b892fabc403f975f37d481a22647f923a3524a12714898937abdfbf875411e50b522134535f8d1852f103310aef5a3 0006-Enable-Wformat-and-Wformat-security-by-default.patch -e568a17fb3348964c0d21e7d67ffeae4f2f0dfd3f2986aaf9cec86c685c13f0c830dfc019b6bd7fe58b8635e5b8fca7ad992a92210f2be285b8cac6467c33a78 0007-Enable-Wtrampolines-by-default.patch -fd47150c72138d47a9faafe8586e84456e09a4ca0ed1ba9be7b5b2a351b1ca2d17b238beaa42c88888402d181933ff68cef0a91f0c3bd26d374706cf71726bbd 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -820be83d93ff5b8d8fc69cdeccec0c6ac2544ee6cce43ae35e6829222791733a1c0b2232fb5a7ad93ab9e6cd677f077d01a4f9dec7aa9c38b013f74aa6c74fc3 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -5be4c0ad27e3b86c06dcaefe34ee1271cb53ded3de9802bc1a8571497240ca870e22534f77adb52dc4556eb4861b94a6c9a39cf6a2e84ef62ee88a04a4a01868 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -5024309e549b7e4a94f2af8bd727144bd27cf8b7cdcbb537a30f3dac28543697c214438da7af491e43cb90daac46344b7b0466729d5c4209ca8a3a0d5a7d027c 0011-libiberty-copy-PIC-objects-during-build-process.patch -c0ebc205f6598edbe6d68b8a287c36ef80826b864e5b92b37f64e7a21ab7048cae67dd5650cd3d1399beb890753ad96e898a94c52d13b3ca7b266a15fed043ca 0012-libitm-disable-FORTIFY.patch -4a4fae02231f49142ab90d4f3dcd093c13032781ff1659f6aca62da13f8c676e2ec9dcdd2e7959ec62835e13c515be9bd7a2e35d3c06768d44d9e1185cb40dac 0013-libgcc_s.patch -9c513a30146364ecd899ca26a27019ea1ba353e8e409e0becb50d2a051022b701586b9276a4f118dbdd131c4882a04cad4188219bb10aa36d7b0bbe2eb2ceb03 0014-nopie.patch -aec141251c3abae35b4dc3ecd3778e332fa5596282fea1fd08c8d5350d8a8740568910236ce8d38c5662232fa5412313cb0a1c7a46c79a5b5e2c643871bf643b 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch -d3fc4ea6918b4c4ce57eb45437f88ec3982bd5c8e17d282003e195dc705e0c84996ec140151b2b2371917595d2d62f30a2cb4676150c1bc8b8fd3b8fb85ecbe9 0016-dlang-update-zlib-binding.patch -4ebf845f41c7a8ba5bfa624c8e1527eb0f15a48d6a8bd151435037bd4b9d71f955ac9b60ab453c0315d592e92f194be92b9c3fca40ed533d64c0a1995c3ad4be 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch -2ca085382a03d269a2f48ec49601328cec7c53eb69856ee55aea11610293c206e8881043030d2295f49a08a5897c9eb9a6126a5ae65edbd967e17e34dadfb2d8 0018-ada-fix-shared-linking.patch -307a1ac2a6cea20c900b7bef2d5d7ad98c2b8cc45bdb2a6adbf151f3228d5de2670c75ddf48e4d3c9ceb7ed42852e24be534773551bc050ad10005faaee2600c 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -d01d0031d97fa42363bd3fb0c0dda9b26e7f06660294f0ceec55624f6564f2ce372b9a255683c67d79dfa18fb8551416c04766debc2e1b9c587ef381eef64f0b 0020-libstdc-futex-add-time64-compatibility.patch -e9eb5ff439cff4a22abaa7b9e27a176b51e1e1f4361fd829bd26e4b5ffc0e4583b1d6728b1510991b069b42f0aae8a2e698f85edecb1d792e4c7e10079507de8 0021-add-fortify-headers-paths.patch -beb7aa26a3731855be2521495186af52d4764973f2bc1ad44554332e867fe52fa37bcb5747395e44ae0011413e702054a60a754ad81dd88bbf97e3c7c718f356 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -ac3288b7840e5cf2500608773f40e604798b30fcb885c9fec7ba0bcc4bcfd374211faa26e82fcf4669bf624d5ccb0bdc747897759be77af3621b8b3bb08bff85 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -7e953227e0d3f1105a754f3fdefbaaca0b106d337c5bcc9b6394712d7f47173f96906517030b508d5a57611cc637848f2e59aec92313b39f1e2221bd98729826 0024-Pure-64-bit-MIPS.patch -12eaad6a8781e76f38bc4ba5c8cd09cfe0a0b95c0cde83fe58dc10bdec542fe43389f2c84bd313629c45af8ed3ffd46cc4478f5a4152ea1eb8d4b8276ede499c 0025-use-pure-64-bit-configuration-where-appropriate.patch -73a649ac371f4a5da68c5f0b88010080efd7deaee29765ef7a299fd1654b5ccdbfee88c59e5d37ae55e37cf6fa218d989e411c04b17e0fd94268ed65d7dcd4bf 0026-always-build-libgcc_eh.a.patch -59d9e0a5f39ad68b8bb1365f7c97a54ca4751cdad01ead8184fd897d8a13156145976a8b5b9856be154c053d6ba11eaad1e5662e7ddda9ba6d2811340df61cba 0027-ada-libgnarl-compatibility-for-musl.patch -8207323c530929517c799b24b1a7ba39c07bbb0e6770f878f1d66088ae16667e7706c9402ac04fe5eb6447a6ad12b548cc7e7612c5b217cd24e7d00094d2a28f 0028-ada-musl-support-fixes.patch -b90f7ad074b6183a4afc6be65349b8bf94b78d1c259d5be9877c16e3de95222fb6905cba7eb6ee4fe1e564ed20bf183c6815bd087896b6b0376656a841736fc1 0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch -39a66708fb7ab4a72e1973749e32c22484e8e6c0afde6a59a645f2536c71cea86c8de2f0448621d53888293121344e84a24617400fae849282df57e0f5ddc21d 0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch -ae0d860324b8b907ff82fcebe4777afae19df85b091723ac55425d24f677fb4e1d14ff4f21cdcdf837dcf730a4c48174e0cc31d1d003a5d11a88c226d5ed3e4a 0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch -a08ea6ce516dc96029153de096b96dcd3262509ee546f1f03152abe8f78c11c75b8dc14de39ccd982896114bf33d2edade2b4810dcc0b2d68e4abf52b67b8a41 0032-gcc-go-Don-t-include-sys-user.h.patch -3bbd3ab3d31fc81cbc6b641919a84807e52b59794f860cad83b9ff69bfd0f5f29aeefc5f19b203bc96db23bf6e5a6958690bd81caa3137eaa5111b5c465273b3 0033-gcc-go-Fix-ucontext_t-on-PPC64.patch -9c410c3a137a18559f1ae5ab5803d5bc8fc596a93da769b4ff2feec516602eb193333d18d55ce39e054b56726a5c243962e8ccdee001ae7e186b4222465b31a3 0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch -78af84111854f5d2de127f03fc0984ea1f9c2c87156be2c454cc88a6791c90817aed63aba2861657560b1d3bc182a31e3d74f7a946e56d831939870240625fb7 0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch -c0d47b5bc478b3e0943806806d81a9183b9d176148e31c75d50cdbb23a34d9c178d751a3fac743d94ebb44c7eae70d3c55ca115acedcf4a1a0bacf46c0c5cd5f 0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch -e9b523a34b5e2930e0c58ee19e903e5416fe65641df80c40937d445d4c8f4f4bde59b3a94a392f5ca0d1c4a87565bd655c186b3a5194cb5bce4de2864d5d025d 0037-gcc-go-signal-34-is-special-on-musl-libc.patch -d75147c2b062b0321b36d843c55887673d8bdac6448da465c29853ac5df3b68153551913476f2ea0fdb6d09df3992e47d457e480b3c16d99e6668b4f941e6e16 0038-gcc-go-Prefer-_off_t-over-_off64_t.patch -a60d2101f49d921cb538fd46650ba550f30721650b40e15fe8a56da32e5f2a3ea62f10d93982ffb45bee2e284cc006141b5d7a96fa12215d63b183b0a67c4c55 0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch -f08cfc9622e84a5a527b626dcca7199a430ab1c02588fef718bcb0155bc5af5a11888aa975e76e55cc2b9b70520a8bf1bcf939e5afe073f6263685686bc9c26f 0040-gcc-go-link-to-libucontext.patch -f27644461c8a3fd27026873639608e53a396e9b9d39c4f330c8eeba82bb9b1e68ae1bfb82c770424399a13762bb3ec147b2699b2cbbdca07628ab3896d806ce4 0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch -32f66f2886448206e216cdabcfd775f378a9fb879e0d0455cec7aec5b5004405175700736f4b48f3c364eab571b1561804b952f0a998103249ef94221bdf8ceb 0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch" +sha512sums="30c3e36c6e001d172b6219dbf5f0383655d29cbed8a197e1d6139213aacbfdb7cbca63553eedf3a4b35bd445a87ee0f555838d8b2cd7a46ab6bba7951a6b60c5 gcc-10.2.1.tar.xz +571e689369e1fd8a9281fed29f9ce5d35cdb6f892f5118216b2b171c5cd16ba5ab1f8f25f8438760bd26bc649b8f4703cc4e7a0918c250933398a37132fb3266 0001-posix_memalign.patch +2ca7d07543105955525e28a899f9cfbafa3f4f58cce8ae9931c20ddebe1126119a5001b8654e3ff7762f84de882dd609ae87f987b31a53dba6d6f5c7b6374a81 0002-gcc-poison-system-directories.patch +772b1bbae7c12cecef87d696603c523d5ea94a6c27f020f5873e6011479e43af735690a1137d4ec2a086946460ce4d411d5a9f00491015a73b04df39942d6dcd 0003-Turn-on-Wl-z-relro-z-now-by-default.patch +5d785525371fdfe89c5c36edf8c694083fc5d25870ef529473386de51e1db2f846d55a48087099230028acc1d076ad29c159603249aedc695cdf14844e2b26c7 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +f467e975f904c01339696f27113ddccac321ef205db4855d46a2a7e9f4ec93e5ab5f9adc19e36a4ef6f61e87fcf9b089ea0727f3ea9736561fb4e9eec4bbf9b0 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +49919bcbd59aea56be90e209d299ddb7b7a295d1db438a769279f4fe57ccf7a028a68227e31a22c1370037a4946a4c7c9ed5ac5044c163fb0f3795d3a2dc26cd 0006-Enable-Wformat-and-Wformat-security-by-default.patch +8374eaa22ef5f26d63226ded57042a8d7d2b69b415e3ff87ec2fc5046404dc062e2e096f329062d047d4e741ed2c5b58b6e1695cf070308f36c9558c6098fdcc 0007-Enable-Wtrampolines-by-default.patch +6be0db2455f5f678d37506773e4493a3cbaefd951486edb3374803813c749c2e6064218950cdc1c06f491fd95d4bd6ae9cbdf83148b332d172c20903eca03aa1 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +d1d1a87177623439a929b42af57a997b48d9e1f6a4ff06b4f84c5f027fc461473dd36145671d2d61b50c0acfcf028d3361be9c95b3340e6e336b012de84f4252 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +167cc80faa6a9daca1a990e87bfc268f27cb620fcd488405f24e397b9a1d6f51a0238d85be4a87f2db93fc1e06ff05d569ce0a2e2fe4db65ec44e15dfb66b994 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +85327918c409bf982c0dc13895324d6fc9cef1c68a3969ba5cf0a9450f2a04e3fa858af5ef7e432fc578cf6b0631cec55921bdcd361724c928eea943b4b5b2f3 0011-libiberty-copy-PIC-objects-during-build-process.patch +f65784f4eebec688f51598a306b9d034ba7feb0c6ac35a45e4f59585097fff820b3de90613941603985cdb5ee1a4c630381146bf2ee8429ffe80f0ffd5aa22c1 0012-libitm-disable-FORTIFY.patch +c489306880b493c92796e145dad372976ff90e42d8a97211e91db59bc75ca20244c96456dc806fd30f878f95878a37f4211f58b0f527b5808467a245186a0e14 0013-libgcc_s.patch +67a045fb5588eeb6776a98fbc0280a97e8b06e26909cab3e55346f6c81d87cf9ed7515afa3648b92ddd455e182fd5e44f6094e44f701676817f9d6fc3aad319e 0014-nopie.patch +b559a0f380065bd62d69359813e855819950a82c2361aa85771081de68bfe5d652936fbe5ad762f029016c643ffc8d62c0bf0e90460bd7d62a1c0f89ddcb5491 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +a42d56b0346208adb4a9f8575d53519c6303ead4eb498bed2ff36b9c20d904d9e1ba5996ec8ee35fb39ba91f30be28a6ab6c3c537a21078670c3ae88762b9a5b 0016-dlang-update-zlib-binding.patch +72313fd4829c8d153b8f4654863ff959597ac25fe657d641cfb5eafb42ae58662dd8581ac7a09eb6dadd2797e3585376fdd1f0207f23c061febdc37a85ea1ba1 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +8f695b5f60d2effca4144373fb0e2d3f1ce4a0c4465669ffb3dd771794b0e18da73b2c3e3644403e91c786ad0c42b54bfeac22543280d40c1a1c2b441c434410 0018-ada-fix-shared-linking.patch +c6800ce569e2da9a379bbb94f1f064833ba66ea1e4dc555e66c45f4ab9e83f40264ca0d06d161df469449b05ddf04907f890b39a1fa8a2bc3e530777d4896371 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +5557ec2a754cd64451a8f186397ff79c509d5781a3e32ba11e6ea45356b13d28ba0b959663540d25725e4bd20934c029a90343bed03b2c0bd143ea73c7f47281 0020-libstdc-futex-add-time64-compatibility.patch +1844d044b1eb3cc72ef72c7efb0623d08d62bbb059dcc254524a378bcc37193126eb52894f6acfea31240457e51c435e28573346d3a19d3d045d12846c07ff8d 0021-add-fortify-headers-paths.patch +210b6a16411c1e5fd00c96c06472c3b7713417ef6f48ea8d127482664d63db8ff5226be2cb2b93420e5f153d96b48e02ba4937d2ad7172c6a0e52ac91a050a2d 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +4a1daeb55c1103b9b52061eb08a3782307e4c9e1a72f4fc20aaa1ecca02931a9678d6a71cbcf8aaf8898da4c95ad639f8d04de07f169d95c16fc58d0db31602e 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +80729605dac33f225eebecbcf6c319e2839c6924483a13bc186092f15f325bf3e972f68328546e394d9e216de0b00e6601ba768b0bb2633ff8c3c0747bb7b1fd 0024-Pure-64-bit-MIPS.patch +ba222bd9ceb95ea9aa729618b95ee81299d20dd5a7840bff47a046d92247e1ea9e2f65d192b1570724da5898fa950a0b8692d505b5c27005d4b143301fd86a52 0025-use-pure-64-bit-configuration-where-appropriate.patch +67e4426be0aeab6b62d7b5e72443f4ea71e4f3fab096b734d656601ad47d44120ef1d9fc87dfef6af2808b39d21cc161cf3d3e45744bd79b56a1071bef5cde94 0026-always-build-libgcc_eh.a.patch +1f9a62459a511a97620147b357a8d1129d1f33a45b3db3a16e049e33b62c23886c37b10152254e84a86d0d2736de06e68e029cf96fa607cf52f15d58e4925b94 0027-ada-libgnarl-compatibility-for-musl.patch +d610a309aebc1aa3a13ce57a69a185b129b02e34cac0f25d7ea3b1dde28551de5e0acc8952b7c877d1f63cbf8f245fb78555d41fee6a55d4d5f68fe92b6a3037 0028-ada-musl-support-fixes.patch +dfa4e5da6206793c63cffef67cf02a443116e63649e6b0466d3c6e24082e5f14eb2640fb9b1b433d2cc4d4755804a360b1b4c572f50638f27169c9f2ef271bdc 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +22aec9116a2dc32add10efcf6bdc502933a318c668aaa9f01d9e7d6aebc1221fd8e6858abd610c556582f9cad0bc15ff7fbb08ca6c7fbe483c481cec3f361712 0030-gcc-go-Don-t-include-sys-user.h.patch +274b227d5d28e9c1d90ce1e29d5d88f938ea775cdd536bd51c8941a55994103ffb37222e395ab36b2fe4676aef106bb63bd510f73590e2ae434f4c6904454363 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch +3c06cf909d3b07a7de89c67afa6596fdc4ed4445ddc299d3b037dab8cb08828726aa7136576ba6b36f4c8b80451215bc356c8f9141b1e1420010f1ad5444943f 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch +f0b6f30c6d934c751ab5d58f3656ab80e02ceac12954a124600b09f2de350ad5a2081a09c2eb5c046fe1969af5022ac27b3bc0c0652cd1986b402334825ca92d 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +7800ae263f8510341cfc4b0daf5771e309f8ac1df9b8b9ad199eb6c792a13d1550f59584a89eda396514692e43940f5f52039cdef64f49a3e1b9ef40282d81be 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +33ae7f190b29667d2740e5f8edb6e69946f5601c3d87e2874cb7314bdfaef798223c018006a1d1932a547d1139ebbce08c3cb8b5f563413eb2ae64b9b8668a1e 0035-gcc-go-signal-34-is-special-on-musl-libc.patch +5f56cecf4b1a00c47c58d75ac8390009d80c8733e63cda90483cbbcb2e89d4e63778e475292378df77e6d2b81603dc43f27b8bb9a36ea384a429f501e6e88eed 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch +a4d3396a34e88723740fe52451992082974ddd2336257d173726f08955806349cbee9ddf1d9ec634365d374a0d61f6b28496ca326fba007b151bc3bed3097fa6 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +85e1f94113cf9e6be00be810b484b2098913ddb6b9f088351e0ae4d96afe5782d7c8687dacda1db8ee7487d14f67ef836bcfe890e94221b6c112c587e373afe0 0038-gcc-go-link-to-libucontext.patch +d332bf5b2af982776aacee359737145b636eaf373214fc58f66666ec6add5032ae1d2cbff6380c0791a0a8010f3c73a68407cd8908385a9bb2ba0295ea3e2370 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch" diff --git a/cross/gcc-armv7/0001-posix_memalign.patch b/cross/gcc-armv7/0001-posix_memalign.patch index afb68c185..826200e09 100644 --- a/cross/gcc-armv7/0001-posix_memalign.patch +++ b/cross/gcc-armv7/0001-posix_memalign.patch @@ -1,7 +1,7 @@ -From 399f9e74a691ca6272d460d72d1b47afcad84752 Mon Sep 17 00:00:00 2001 +From 4ed2cc3054f444c683f54954c32e586a54066337 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 26 Jan 2018 20:32:50 +0000 -Subject: [PATCH 01/30] posix_memalign +Subject: [PATCH 01/39] posix_memalign --- gcc/config/i386/pmm_malloc.h | 9 +++++---- @@ -38,5 +38,5 @@ index 87344d9383f..ece428df487 100644 else return NULL; -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0002-gcc-poison-system-directories.patch b/cross/gcc-armv7/0002-gcc-poison-system-directories.patch index e388dd1be..6dec763f8 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 0e993b1b9a33910193862d76facf34bdbe58ed01 Mon Sep 17 00:00:00 2001 +From 09a32a40b34477cd787deb12833c063a09dea7b2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 29 Mar 2013 08:59:00 +0400 -Subject: [PATCH 02/30] gcc: poison-system-directories +Subject: [PATCH 02/39] gcc: poison-system-directories Add /sw/include and /opt/include based on the original zecke-no-host-includes.patch patch. The original patch checked for @@ -26,7 +26,7 @@ Upstream-Status: Pending 7 files changed, 68 insertions(+) diff --git a/gcc/common.opt b/gcc/common.opt -index 3ec7743eae8..d3c3e51dcb0 100644 +index dfed6ec76ba..8bb65e0e1af 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -682,6 +682,10 @@ Wreturn-local-addr @@ -58,7 +58,7 @@ index 364eba47737..9551c0dfdf9 100644 optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive. */ diff --git a/gcc/configure b/gcc/configure -index eb6061c1631..90e3be864f8 100755 +index b4088d8fd1e..793530e21cf 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1010,6 +1010,7 @@ with_system_zlib @@ -78,7 +78,7 @@ index eb6061c1631..90e3be864f8 100755 --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --disable-libquadmath-support -@@ -30266,6 +30269,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : +@@ -30271,6 +30274,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : fi @@ -99,10 +99,10 @@ index eb6061c1631..90e3be864f8 100755 diff --git a/gcc/configure.ac b/gcc/configure.ac -index 715fcba0482..f42006e5476 100644 +index 070b9c6c497..0fd438e39e5 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6600,6 +6600,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, +@@ -6605,6 +6605,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [specify that runtime libraries should be installed in a compiler-specific directory])]) @@ -120,7 +120,7 @@ index 715fcba0482..f42006e5476 100644 AC_SUBST(subdirs) AC_SUBST(srcdir) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index a2794a67d1e..dfed8fd25a8 100644 +index 0d532a64bfe..86e57038042 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}. @@ -131,7 +131,7 @@ index a2794a67d1e..dfed8fd25a8 100644 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol -Wrestrict -Wno-return-local-addr -Wreturn-type @gol -Wno-scalar-storage-order -Wsequence-point @gol -@@ -6924,6 +6925,14 @@ made up of data only and thus requires no special treatment. But, for +@@ -6926,6 +6927,14 @@ made up of data only and thus requires no special treatment. But, for most targets, it is made up of code and thus requires the stack to be made executable in order for the program to work properly. @@ -199,5 +199,5 @@ index 8a2bda00f80..9098ab044ab 100644 /* Use given -I paths for #include "..." but not #include <...>, and -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0003-Turn-on-Wl-z-relro-z-now-by-default.patch b/cross/gcc-armv7/0003-Turn-on-Wl-z-relro-z-now-by-default.patch index 511636e52..ab9cc6d94 100644 --- a/cross/gcc-armv7/0003-Turn-on-Wl-z-relro-z-now-by-default.patch +++ b/cross/gcc-armv7/0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -1,7 +1,7 @@ -From a35a55940c3402f8ebb510ec7d8bc67e85051277 Mon Sep 17 00:00:00 2001 +From 77e75a23e9bdf8863823225567c509b6fed49e6e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 -Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default. +Subject: [PATCH 03/39] Turn on -Wl,-z,relro,-z,now by default. --- gcc/doc/invoke.texi | 3 +++ @@ -9,10 +9,10 @@ Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default. 2 files changed, 4 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index dfed8fd25a8..ca56d52cb05 100644 +index 86e57038042..87ff404bc20 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -14638,6 +14638,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the +@@ -14645,6 +14645,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}. @@ -35,5 +35,5 @@ index b2200c5185a..625c9ab7902 100644 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ %{Wno-poison-system-directories:--no-poison-system-directories} \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch b/cross/gcc-armv7/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch index d2b423318..5a652beab 100644 --- a/cross/gcc-armv7/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +++ b/cross/gcc-armv7/0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch @@ -1,7 +1,7 @@ -From d2865d0a184ef59be8893dd34edf5037c4bf48f7 Mon Sep 17 00:00:00 2001 +From 3b76b0c848746d4adbc4e8db408efd41aefb829c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:22 +0000 -Subject: [PATCH 04/30] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, +Subject: [PATCH 04/39] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, if the optimization level is > 0 --- @@ -25,10 +25,10 @@ index db91a36794a..ed976c71404 100644 if (flag_gnu89_inline) cpp_define (pfile, "__GNUC_GNU_INLINE__"); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi -index ca56d52cb05..f5d5a1d1542 100644 +index 87ff404bc20..01e67e97491 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -9228,6 +9228,12 @@ also turns on the following optimization flags: +@@ -9230,6 +9230,12 @@ also turns on the following optimization flags: Please note the warning under @option{-fgcse} about invoking @option{-O2} on programs that use computed gotos. @@ -42,5 +42,5 @@ index ca56d52cb05..f5d5a1d1542 100644 @opindex O3 Optimize yet more. @option{-O3} turns on all optimizations specified -- -2.27.0 +2.28.0 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 41206fa9f..b60112aa3 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,7 +1,7 @@ -From 872e0a15a2b74cd6b6ba58e2e7e1605543ea36bd Mon Sep 17 00:00:00 2001 +From 483912c560424ee8b5cc996990d45802671fc73f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:46:56 +0000 -Subject: [PATCH 05/30] On linux targets pass --as-needed by default to the +Subject: [PATCH 05/39] On linux targets pass --as-needed by default to the linker, but always link the sanitizer libraries with --no-as-needed. --- @@ -192,10 +192,10 @@ index 6919b468f06..56d52d41b31 100644 %{!shared: \ %{static:-static} \ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h -index 81201e67a2f..6477d7ec52e 100644 +index 63853e60c03..de6d8675456 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h -@@ -87,7 +87,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); +@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" #undef LINK_SPEC @@ -265,5 +265,5 @@ index 625c9ab7902..7aec9d3a016 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.27.0 +2.28.0 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 37ab133e9..01d7d7d29 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,7 +1,7 @@ -From 5e20872b8cc916cb457c63c6cd970c4fcba47bbb Mon Sep 17 00:00:00 2001 +From c57a8b43401ca9a1b889fa9fd421ac49c3dbd380 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:47:43 +0000 -Subject: [PATCH 06/30] Enable -Wformat and -Wformat-security by default. +Subject: [PATCH 06/39] Enable -Wformat and -Wformat-security by default. --- gcc/c-family/c.opt | 4 ++-- @@ -30,5 +30,5 @@ index c49da99d395..93f25319005 100644 Wformat-overflow= -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch index 31a7faa03..c2d64dff7 100644 --- a/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch +++ b/cross/gcc-armv7/0007-Enable-Wtrampolines-by-default.patch @@ -1,14 +1,14 @@ -From 1bcf7e30226852db956becebaffdfe2738923423 Mon Sep 17 00:00:00 2001 +From a58dad2c52639422671ac6986c36e48499fc2f20 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:48:24 +0000 -Subject: [PATCH 07/30] Enable -Wtrampolines by default. +Subject: [PATCH 07/39] Enable -Wtrampolines by default. --- gcc/common.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt -index d3c3e51dcb0..7b68397c232 100644 +index 8bb65e0e1af..ace932b300d 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning @@ -21,5 +21,5 @@ index d3c3e51dcb0..7b68397c232 100644 Wtype-limits -- -2.27.0 +2.28.0 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 index 0b3ce1a78..f7d30e3b0 100644 --- 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 @@ -1,7 +1,7 @@ -From 23fd86ff34670873dd294bd87b93f45c3624903a Mon Sep 17 00:00:00 2001 +From 98b2b8f7de60ed1b6b7602124ef6db278cf3c212 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:49:40 +0000 -Subject: [PATCH 08/30] Disable ssp on -nostdlib, -nodefaultlibs and +Subject: [PATCH 08/39] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding Change the buffer size. --- @@ -49,5 +49,5 @@ index 4aec480798b..eaecfab37ad 100644 -param=stack-clash-protection-guard-size= -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch b/cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch index 0e059262e..f8f8eea78 100644 --- a/cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +++ b/cross/gcc-armv7/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -1,7 +1,7 @@ -From d27d7936ecd9f357a3c6ee05e6548f8a68fdd4b7 Mon Sep 17 00:00:00 2001 +From 035775ef38206ed2859500efe5fb42ceec2e858d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:50:33 +0000 -Subject: [PATCH 09/30] Ensure that msgfmt doesn't encounter problems during +Subject: [PATCH 09/39] Ensure that msgfmt doesn't encounter problems during gcc bootstrapping. Solves error messages like the following: @@ -50,5 +50,5 @@ index a0f84b0cfa0..ab24a47a2fd 100644 all-local: all-local-$(USE_NLS) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch b/cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch index d85b7c593..49118500f 100644 --- a/cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +++ b/cross/gcc-armv7/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -1,7 +1,7 @@ -From 2ec258d6d31e2c0c614c5086acee84a87768a67c Mon Sep 17 00:00:00 2001 +From e9875d74e75c601b95dba677bc9e58c869150212 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:52:07 +0000 -Subject: [PATCH 10/30] Don't declare asprintf if defined as a macro. +Subject: [PATCH 10/39] Don't declare asprintf if defined as a macro. --- include/libiberty.h | 3 +++ @@ -24,5 +24,5 @@ index 141cb886a85..fa0e78eb62f 100644 /* Like asprintf but allocates memory without fail. This works like xmalloc. */ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch b/cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch index 770cad546..6a1450675 100644 --- a/cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch +++ b/cross/gcc-armv7/0011-libiberty-copy-PIC-objects-during-build-process.patch @@ -1,7 +1,7 @@ -From 4f6fd2272f57620da399d0f841fce12b9db3b2d1 Mon Sep 17 00:00:00 2001 +From 764e64bba73a7b7eb5154c8537781412252ed33e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:00 +0000 -Subject: [PATCH 11/30] libiberty: copy PIC objects during build process +Subject: [PATCH 11/39] libiberty: copy PIC objects during build process --- libiberty/Makefile.in | 1 + @@ -20,5 +20,5 @@ index d6b302e02fd..fd39928546f 100644 else true; fi -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0012-libitm-disable-FORTIFY.patch b/cross/gcc-armv7/0012-libitm-disable-FORTIFY.patch index 169361398..ba2e1fa9f 100644 --- a/cross/gcc-armv7/0012-libitm-disable-FORTIFY.patch +++ b/cross/gcc-armv7/0012-libitm-disable-FORTIFY.patch @@ -1,7 +1,7 @@ -From cef5e0336cfdf4afd0e01fa9e562f686b234697a Mon Sep 17 00:00:00 2001 +From da46d99b1b7661a98064a45bdccf08c1867582b0 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:53:36 +0000 -Subject: [PATCH 12/30] libitm: disable FORTIFY +Subject: [PATCH 12/39] libitm: disable FORTIFY --- libitm/configure.tgt | 10 ++++++++++ @@ -29,5 +29,5 @@ index 04109160e91..107b957ece3 100644 # work out any special compilation flags as necessary. case "${target_cpu}" in -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0013-libgcc_s.patch b/cross/gcc-armv7/0013-libgcc_s.patch index f04d7f7c0..d0636b2bc 100644 --- a/cross/gcc-armv7/0013-libgcc_s.patch +++ b/cross/gcc-armv7/0013-libgcc_s.patch @@ -1,7 +1,7 @@ -From d31721459e363e49dfe0a7797300864d9cef92f0 Mon Sep 17 00:00:00 2001 +From 354f2a8ceb70f9f6e1688ba41c1cc1c17ac87329 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 24 Oct 2015 20:09:53 +0000 -Subject: [PATCH 13/30] libgcc_s +Subject: [PATCH 13/39] libgcc_s --- gcc/config/i386/i386-expand.c | 4 ++-- @@ -10,10 +10,10 @@ Subject: [PATCH 13/30] libgcc_s 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c -index 6c759b01edf..8cf0e069e1c 100644 +index c6033688f51..a60e5162995 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c -@@ -10948,10 +10948,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, +@@ -10966,10 +10966,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, { case IX86_BUILTIN_CPU_INIT: { @@ -53,5 +53,5 @@ index 8506a635790..564296f788e 100644 +HOST_LIBGCC2_CFLAGS += -mlong-double-80 $(CET_FLAGS) CRTSTUFF_T_CFLAGS += $(CET_FLAGS) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0014-nopie.patch b/cross/gcc-armv7/0014-nopie.patch index 086031937..ed8f503c8 100644 --- a/cross/gcc-armv7/0014-nopie.patch +++ b/cross/gcc-armv7/0014-nopie.patch @@ -1,7 +1,7 @@ -From f64f853eae3b390adbbc9b74a336d93918e6dca4 Mon Sep 17 00:00:00 2001 +From 7fb84007ff62309abffdbddfa751e69c331e82c3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 7 Nov 2015 02:08:05 +0000 -Subject: [PATCH 14/30] nopie +Subject: [PATCH 14/39] nopie --- gcc/configure | 27 +++++++++++++++++++++++++++ @@ -9,10 +9,10 @@ Subject: [PATCH 14/30] nopie 2 files changed, 40 insertions(+) diff --git a/gcc/configure b/gcc/configure -index 90e3be864f8..951a093b459 100755 +index 793530e21cf..2d874d3defe 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -30774,6 +30774,33 @@ fi +@@ -30779,6 +30779,33 @@ fi $as_echo "$gcc_cv_no_pie" >&6; } if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -47,10 +47,10 @@ index 90e3be864f8..951a093b459 100755 diff --git a/gcc/configure.ac b/gcc/configure.ac -index f42006e5476..fe392298016 100644 +index 0fd438e39e5..0b257e687ee 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6858,6 +6858,19 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -6863,6 +6863,19 @@ AC_CACHE_CHECK([for -no-pie option], LDFLAGS="$saved_LDFLAGS"]) if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -71,5 +71,5 @@ index f42006e5476..fe392298016 100644 AC_SUBST([NO_PIE_FLAG]) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch b/cross/gcc-armv7/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch index 8f007668f..b7bd1857f 100644 --- a/cross/gcc-armv7/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +++ b/cross/gcc-armv7/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch @@ -1,7 +1,7 @@ -From 37dace030c1402a8e6734a0fc59e18717ce1a2ef Mon Sep 17 00:00:00 2001 +From 3f764eb6dc371cc48cfdf231cbd40e64b1f2a671 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:57:09 +0000 -Subject: [PATCH 15/30] libffi: use __linux__ instead of __gnu_linux__ for musl +Subject: [PATCH 15/39] libffi: use __linux__ instead of __gnu_linux__ for musl --- libffi/src/closures.c | 2 +- @@ -21,5 +21,5 @@ index 721ff00ea43..22a699c6340 100644 with both write and execute permission. Code compiled when this option is defined will attempt to map such pages once, but if it -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0016-dlang-update-zlib-binding.patch b/cross/gcc-armv7/0016-dlang-update-zlib-binding.patch index 9204db8a8..b2dcb0eb1 100644 --- a/cross/gcc-armv7/0016-dlang-update-zlib-binding.patch +++ b/cross/gcc-armv7/0016-dlang-update-zlib-binding.patch @@ -1,7 +1,7 @@ -From 7fc386a2e629e859968da4eb4d0ff4983cb3b76f Mon Sep 17 00:00:00 2001 +From b78dea0f8f09d4092bec52b7ada719ead2552dd2 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:57:51 +0000 -Subject: [PATCH 16/30] dlang: update zlib binding +Subject: [PATCH 16/39] dlang: update zlib binding --- libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++----------- @@ -421,5 +421,5 @@ index e6cce240fd5..bd2fe37ebec 100644 } -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch b/cross/gcc-armv7/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch index 7b11d6bae..570c44c4b 100644 --- a/cross/gcc-armv7/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +++ b/cross/gcc-armv7/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch @@ -1,7 +1,7 @@ -From ef5f7880cff27a2b92952ce53a207d5dd896923b Mon Sep 17 00:00:00 2001 +From 58c529af8a9673b90dc7137065ab788c25b358a8 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:58:22 +0000 -Subject: [PATCH 17/30] dlang: fix fcntl on mips, add libucontext dep +Subject: [PATCH 17/39] dlang: fix fcntl on mips, add libucontext dep --- libphobos/configure.tgt | 1 + @@ -47,5 +47,5 @@ index 9febcff849b..cb34e2108bd 100644 static assert(0, "Platform not supported"); -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0018-ada-fix-shared-linking.patch b/cross/gcc-armv7/0018-ada-fix-shared-linking.patch index 1fc9b372b..6486564c1 100644 --- a/cross/gcc-armv7/0018-ada-fix-shared-linking.patch +++ b/cross/gcc-armv7/0018-ada-fix-shared-linking.patch @@ -1,7 +1,7 @@ -From b675e0383262d6d702f5b732e4459d3e2c2a4891 Mon Sep 17 00:00:00 2001 +From 2a614f9b702b02c312cd513eddb1fc6745f9a3ad Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:16 +0000 -Subject: [PATCH 18/30] ada: fix shared linking +Subject: [PATCH 18/39] ada: fix shared linking --- gcc/ada/link.c | 12 ++++++------ @@ -38,5 +38,5 @@ index 02c413a412f..f0e52a87d6e 100644 unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-armv7/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch index 591f9ffa3..788c0fb9b 100644 --- a/cross/gcc-armv7/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +++ b/cross/gcc-armv7/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -1,7 +1,7 @@ -From 0ea91dd6f8d856d5b589c2a3e95469fea06e7094 Mon Sep 17 00:00:00 2001 +From dab36b973223e0d6853f564e845bc22dadcc4d2d Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:59:43 +0000 -Subject: [PATCH 19/30] build: fix CXXFLAGS_FOR_BUILD passing +Subject: [PATCH 19/39] build: fix CXXFLAGS_FOR_BUILD passing --- Makefile.in | 1 + @@ -20,5 +20,5 @@ index 36e369df6e7..63627db68cf 100644 # This is the list of directories to built for the host system. -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0020-libstdc-futex-add-time64-compatibility.patch b/cross/gcc-armv7/0020-libstdc-futex-add-time64-compatibility.patch index 73d7f0730..8d5f43888 100644 --- a/cross/gcc-armv7/0020-libstdc-futex-add-time64-compatibility.patch +++ b/cross/gcc-armv7/0020-libstdc-futex-add-time64-compatibility.patch @@ -1,7 +1,7 @@ -From 9684a815e1cbe854383c3c511e1d84d43c46ec94 Mon Sep 17 00:00:00 2001 +From c2efb7703c2ef381a8b1d1cd751222e0a7e10665 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:00:17 +0000 -Subject: [PATCH 20/30] libstdc++: futex: add time64 compatibility +Subject: [PATCH 20/39] libstdc++: futex: add time64 compatibility --- libstdc++-v3/src/c++11/futex.cc | 8 ++++++++ @@ -28,5 +28,5 @@ index c9de11a7ec7..7be702dbeda 100644 rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; if (rt.tv_nsec < 0) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0021-add-fortify-headers-paths.patch b/cross/gcc-armv7/0021-add-fortify-headers-paths.patch index 81e26a47e..0d14a614b 100644 --- a/cross/gcc-armv7/0021-add-fortify-headers-paths.patch +++ b/cross/gcc-armv7/0021-add-fortify-headers-paths.patch @@ -1,7 +1,7 @@ -From a0708ec975c01b049d254dc51179898966bf8a52 Mon Sep 17 00:00:00 2001 +From ca8a8331acef15d0b3b095b8c63539acd1d93e8b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:01:06 +0000 -Subject: [PATCH 21/30] add fortify-headers paths +Subject: [PATCH 21/39] add fortify-headers paths --- gcc/config/linux.h | 2 ++ @@ -21,5 +21,5 @@ index 95654bcdb5a..d88df8f154a 100644 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, #else -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-armv7/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch index a93b372e9..5f1ae3c8c 100644 --- a/cross/gcc-armv7/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +++ b/cross/gcc-armv7/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -1,7 +1,7 @@ -From 740342a0e4b0b3af498964440918abba1a27ba33 Mon Sep 17 00:00:00 2001 +From 23468db70f830e99ac138826d28cc33fa71d3405 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 22/30] Alpine musl package provides libssp_nonshared.a. We +Subject: [PATCH 22/39] 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 @@ -27,5 +27,5 @@ index daeb4d0c8ea..6920bec0fa0 100644 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-armv7/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch index 4717d7416..8d0e39ba5 100644 --- a/cross/gcc-armv7/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +++ b/cross/gcc-armv7/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -1,7 +1,7 @@ -From 775adf35d6f34f61947fc28a2bdbfa7e881c40d5 Mon Sep 17 00:00:00 2001 +From 67513cb76a43014172f54384c3bad0c41e949c8a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:03:42 +0000 -Subject: [PATCH 23/30] DP: Use --push-state/--pop-state for gold as well when +Subject: [PATCH 23/39] DP: Use --push-state/--pop-state for gold as well when linking libtsan. --- @@ -65,5 +65,5 @@ index 6920bec0fa0..40e07354b3d 100644 #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0024-Pure-64-bit-MIPS.patch b/cross/gcc-armv7/0024-Pure-64-bit-MIPS.patch index 95cefb3dd..55021c8f8 100644 --- a/cross/gcc-armv7/0024-Pure-64-bit-MIPS.patch +++ b/cross/gcc-armv7/0024-Pure-64-bit-MIPS.patch @@ -1,7 +1,7 @@ -From 717090cf538f765db1730956c512a43f2d52a802 Mon Sep 17 00:00:00 2001 +From 5d9d38da4f523c052a5bcd2562d79809b4136f2c Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Thu, 21 Dec 2017 03:14:33 +0100 -Subject: [PATCH 24/30] Pure 64-bit MIPS +Subject: [PATCH 24/39] Pure 64-bit MIPS --- gcc/config/mips/mips.h | 8 ++++---- @@ -43,5 +43,5 @@ index ceb58d3b5f3..8116e23ebba 100644 + ../lib32 \ + ../lib -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0025-use-pure-64-bit-configuration-where-appropriate.patch b/cross/gcc-armv7/0025-use-pure-64-bit-configuration-where-appropriate.patch index 8e2db4831..2c2d3030b 100644 --- a/cross/gcc-armv7/0025-use-pure-64-bit-configuration-where-appropriate.patch +++ b/cross/gcc-armv7/0025-use-pure-64-bit-configuration-where-appropriate.patch @@ -1,7 +1,7 @@ -From f73cf8d2f8f4eee71fc2ba850672e69f509a4486 Mon Sep 17 00:00:00 2001 +From ac0eeb3237ac2cf75c19be92afe3335c9a0d83bb Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:04:40 +0000 -Subject: [PATCH 25/30] use pure 64-bit configuration where appropriate +Subject: [PATCH 25/39] use pure 64-bit configuration where appropriate --- gcc/config/aarch64/t-aarch64-linux | 2 +- @@ -117,5 +117,5 @@ index cc6ab367072..7f498ee1cdc 100644 +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0026-always-build-libgcc_eh.a.patch b/cross/gcc-armv7/0026-always-build-libgcc_eh.a.patch index b41f8e9ed..d89d12b8c 100644 --- a/cross/gcc-armv7/0026-always-build-libgcc_eh.a.patch +++ b/cross/gcc-armv7/0026-always-build-libgcc_eh.a.patch @@ -1,7 +1,7 @@ -From 8472f6d0037dcd19c44b1e95d95fbf937b3823e6 Mon Sep 17 00:00:00 2001 +From 3f35cf750117fa7cbceaf33e4bea008d0688bd93 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:05:41 +0000 -Subject: [PATCH 26/30] always build libgcc_eh.a +Subject: [PATCH 26/39] always build libgcc_eh.a highly inspired by: http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch @@ -47,5 +47,5 @@ index 851e7657d07..99ec513a1a6 100644 for file in $$parts; do \ rm -f $(DESTDIR)$(inst_libdir)/$$file; \ -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0027-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-armv7/0027-ada-libgnarl-compatibility-for-musl.patch index f44caa24c..15b17fbbd 100644 --- a/cross/gcc-armv7/0027-ada-libgnarl-compatibility-for-musl.patch +++ b/cross/gcc-armv7/0027-ada-libgnarl-compatibility-for-musl.patch @@ -1,7 +1,7 @@ -From 4e1b3a26f558e7693853d3600ee677705e67406c Mon Sep 17 00:00:00 2001 +From 48342d154084bb9610b8f02f93fcfc2aa606595a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:06:30 +0000 -Subject: [PATCH 27/30] ada: libgnarl compatibility for musl +Subject: [PATCH 27/39] ada: libgnarl compatibility for musl --- gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ @@ -131,5 +131,5 @@ index c45559e5ba0..0b0f173e7d4 100644 pragma Assert (Result in 0 | ENOMEM); -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0028-ada-musl-support-fixes.patch b/cross/gcc-armv7/0028-ada-musl-support-fixes.patch index 8eb13422c..b776c58c5 100644 --- a/cross/gcc-armv7/0028-ada-musl-support-fixes.patch +++ b/cross/gcc-armv7/0028-ada-musl-support-fixes.patch @@ -1,7 +1,7 @@ -From 5e3d7d2f1e2448b6c5eb207f9251c437629e43bc Mon Sep 17 00:00:00 2001 +From 0d517a7c90f9e21616c8ad0c66e24c1554f6658c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 07:07:48 +0000 -Subject: [PATCH 28/30] ada: musl support fixes +Subject: [PATCH 28/39] ada: musl support fixes --- gcc/ada/Makefile.rtl | 10 +++++----- @@ -219,5 +219,5 @@ index af4417fab90..bab6bf3ca87 100644 status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); #elif defined (USE_CLONE_DEVICE) -- -2.27.0 +2.28.0 diff --git a/cross/gcc-armv7/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch b/cross/gcc-armv7/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch deleted file mode 100644 index 13500dafe..000000000 --- a/cross/gcc-armv7/0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch +++ /dev/null @@ -1,520 +0,0 @@ -From d6599f89ba558ec2a68d4bc4af15cf3513218054 Mon Sep 17 00:00:00 2001 -From: Richard Sandiford -Date: Mon, 3 Aug 2020 09:48:36 +0100 -Subject: [PATCH 29/30] c: Fix bogus vector initialisation error [PR96377] - -One of the problems in this PR was that if we had: - - vector_type1 array[] = { vector_value1 }; - -process_init_element would only treat vector_value1 as initialising -a vector_type1 if they had the same TYPE_MAIN_VARIANT. This has -several problems: - -(1) It gives confusing error messages if the vector types are - incompatible. (Tested by gcc.dg/pr96377-1.c.) - -(2) It means that we reject code that should be valid with - -flax-vector-conversions. (Tested by gcc.dg/pr96377-2.c.) - -(3) On arm and aarch64 targets, it means that we reject some - initializers that mix Advanced SIMD and standard GNU vectors. - These vectors have traditionally had different TYPE_MAIN_VARIANTs - because they have different mangling schemes. (Tested by - gcc.dg/pr96377-[3-6].c.) - -(4) It means that we reject SVE initializers that should be valid. - (Tested by gcc.target/aarch64/sve/gnu_vectors_[34].c.) - -(5) After r11-1741-g:31427b974ed7b7dd54e2 we reject: - - arm_neon_type1 array[] = { k ^ arm_neon_value1 }; - - because applying the binary operator to arm_neon_value1 strips - the "Advanced SIMD type" attributes that were added in that patch. - Stripping the attributes is problematic for other reasons though, - so that still needs to be fixed separately. - -g++.target/aarch64/sve/gnu_vectors_[34].C already pass. - -gcc/c/ - PR c/96377 - * c-typeck.c (process_init_element): Split test for whether to - recurse into a record, union or array into... - (initialize_elementwise_p): ...this new function. Don't recurse - into a vector type if the initialization value is also a vector. - -gcc/testsuite/ - PR c/96377 - * gcc.dg/pr96377-1.c: New test. - * gcc.dg/pr96377-2.c: Likewise. - * gcc.dg/pr96377-3.c: Likewise. - * gcc.dg/pr96377-4.c: Likewise. - * gcc.dg/pr96377-5.c: Likewise. - * gcc.dg/pr96377-6.c: Likewise. - * gcc.target/aarch64/pr96377-1.c: Likewise. - * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c: Likewise. - * gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c: Likewise. - * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C: Likewise. - * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C: Likewise. - -(cherry picked from commit 7d599ad27b9bcf5165f87710f1abc64bbabd06ae) ---- - gcc/c/c-typeck.c | 59 ++++++++++++++----- - .../sve/acle/general-c++/gnu_vectors_3.C | 15 +++++ - .../sve/acle/general-c++/gnu_vectors_4.C | 15 +++++ - gcc/testsuite/gcc.dg/pr96377-1.c | 32 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-2.c | 31 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-3.c | 33 +++++++++++ - gcc/testsuite/gcc.dg/pr96377-4.c | 32 ++++++++++ - gcc/testsuite/gcc.dg/pr96377-5.c | 33 +++++++++++ - gcc/testsuite/gcc.dg/pr96377-6.c | 32 ++++++++++ - gcc/testsuite/gcc.target/aarch64/pr96377-1.c | 20 +++++++ - .../sve/acle/general-c/gnu_vectors_3.c | 15 +++++ - .../sve/acle/general-c/gnu_vectors_4.c | 15 +++++ - 12 files changed, 317 insertions(+), 15 deletions(-) - create mode 100644 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C - create mode 100644 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C - create mode 100644 gcc/testsuite/gcc.dg/pr96377-1.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-2.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-3.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-4.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-5.c - create mode 100644 gcc/testsuite/gcc.dg/pr96377-6.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/pr96377-1.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c - create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c - -diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c -index eb4b641e6bb..58762f10a93 100644 ---- a/gcc/c/c-typeck.c -+++ b/gcc/c/c-typeck.c -@@ -9910,6 +9910,47 @@ output_pending_init_elements (int all, struct obstack * braced_init_obstack) - goto retry; - } - -+/* Expression VALUE coincides with the start of type TYPE in a braced -+ initializer. Return true if we should treat VALUE as initializing -+ the first element of TYPE, false if we should treat it as initializing -+ TYPE as a whole. -+ -+ If the initializer is clearly invalid, the question becomes: -+ which choice gives the best error message? */ -+ -+static bool -+initialize_elementwise_p (tree type, tree value) -+{ -+ if (type == error_mark_node || value == error_mark_node) -+ return false; -+ -+ gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type); -+ -+ tree value_type = TREE_TYPE (value); -+ if (value_type == error_mark_node) -+ return false; -+ -+ /* GNU vectors can be initialized elementwise. However, treat any -+ kind of vector value as initializing the vector type as a whole, -+ regardless of whether the value is a GNU vector. Such initializers -+ are valid if and only if they would have been valid in a non-braced -+ initializer like: -+ -+ TYPE foo = VALUE; -+ -+ so recursing into the vector type would be at best confusing or at -+ worst wrong. For example, when -flax-vector-conversions is in effect, -+ it's possible to initialize a V8HI from a V4SI, even though the vectors -+ have different element types and different numbers of elements. */ -+ if (gnu_vector_type_p (type)) -+ return !VECTOR_TYPE_P (value_type); -+ -+ if (AGGREGATE_TYPE_P (type)) -+ return type != TYPE_MAIN_VARIANT (value_type); -+ -+ return false; -+} -+ - /* Add one non-braced element to the current constructor level. - This adjusts the current position within the constructor's type. - This may also start or terminate implicit levels -@@ -10089,11 +10130,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype -- && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE -- || fieldcode == UNION_TYPE -- || gnu_vector_type_p (fieldtype))) -+ && initialize_elementwise_p (fieldtype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -@@ -10181,11 +10218,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype -- && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE -- || fieldcode == UNION_TYPE -- || gnu_vector_type_p (fieldtype))) -+ && initialize_elementwise_p (fieldtype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -@@ -10224,11 +10257,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, - /* Otherwise, if we have come to a subaggregate, - and we don't have an element of its type, push into it. */ - else if (value.value != NULL_TREE -- && value.value != error_mark_node -- && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != elttype -- && (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE -- || eltcode == UNION_TYPE -- || gnu_vector_type_p (elttype))) -+ && initialize_elementwise_p (elttype, value.value)) - { - push_init_level (loc, 1, braced_init_obstack); - continue; -diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C -new file mode 100644 -index 00000000000..e607d58d726 ---- /dev/null -+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_3.C -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "cannot convert" } -+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "cannot convert" } -+} -diff --git a/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C -new file mode 100644 -index 00000000000..ac4e0d12ff8 ---- /dev/null -+++ b/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_4.C -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; -+ gnu_uint8_t arr3[] = { sve_s1 }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-1.c b/gcc/testsuite/gcc.dg/pr96377-1.c -new file mode 100644 -index 00000000000..2bf3f816331 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-1.c -@@ -0,0 +1,32 @@ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-2.c b/gcc/testsuite/gcc.dg/pr96377-2.c -new file mode 100644 -index 00000000000..f58b06d9076 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-2.c -@@ -0,0 +1,31 @@ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-3.c b/gcc/testsuite/gcc.dg/pr96377-3.c -new file mode 100644 -index 00000000000..66dce01f277 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-3.c -@@ -0,0 +1,33 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (__Int32x4_t i, __Int16x8_t h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__vector" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-4.c b/gcc/testsuite/gcc.dg/pr96377-4.c -new file mode 100644 -index 00000000000..f7aaf490031 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-4.c -@@ -0,0 +1,32 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { v8hi x; v4si y; }; -+union u1 { v8hi x; v4si y; }; -+union u2 { v4si s; v8hi y; }; -+ -+void -+foo (__Int32x4_t i, __Int16x8_t h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-5.c b/gcc/testsuite/gcc.dg/pr96377-5.c -new file mode 100644 -index 00000000000..3d0c24befa6 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-5.c -@@ -0,0 +1,33 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-fno-lax-vector-conversions" } */ -+/* { dg-message "use '-flax-vector-conversions' to permit conversions" "" { target *-*-* } 0 } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { __Int16x8_t x; __Int32x4_t y; }; -+union u1 { __Int16x8_t x; __Int32x4_t y; }; -+union u2 { __Int32x4_t s; __Int16x8_t y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; // { dg-error "incompatible types when initializing type '__Int16x8_t" } -+ struct s x2 = { h, h }; // { dg-error "incompatible types" } -+ struct s x3 = { i, h }; // { dg-error "incompatible types" } -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; // { dg-error "incompatible types" } -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; // { dg-error "incompatible types" } -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; // { dg-error "incompatible types" } -+ v4si z3[] = { h, i }; // { dg-error "incompatible types" } -+ v4si z4[] = { h, h }; // { dg-error "incompatible types" } -+ v8hi z5[] = { i, i }; // { dg-error "incompatible types" } -+ v8hi z6[] = { i, h }; // { dg-error "incompatible types" } -+ v8hi z7[] = { h, i }; // { dg-error "incompatible types" } -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.dg/pr96377-6.c b/gcc/testsuite/gcc.dg/pr96377-6.c -new file mode 100644 -index 00000000000..165327fa292 ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/pr96377-6.c -@@ -0,0 +1,32 @@ -+/* { dg-do compile { target aarch64*-*-* } } */ -+/* { dg-options "-flax-vector-conversions" } */ -+ -+typedef int v4si __attribute__((vector_size(16))); -+typedef short v8hi __attribute__((vector_size(16))); -+ -+struct s { __Int16x8_t x; __Int32x4_t y; }; -+union u1 { __Int16x8_t x; __Int32x4_t y; }; -+union u2 { __Int32x4_t s; __Int16x8_t y; }; -+ -+void -+foo (v4si i, v8hi h) -+{ -+ struct s x1 = { i, i }; -+ struct s x2 = { h, h }; -+ struct s x3 = { i, h }; -+ struct s x4 = { h, i }; -+ -+ union u1 y1 = { i }; -+ union u1 y2 = { h }; -+ union u2 y3 = { i }; -+ union u2 y4 = { h }; -+ -+ v4si z1[] = { i, i }; -+ v4si z2[] = { i, h }; -+ v4si z3[] = { h, i }; -+ v4si z4[] = { h, h }; -+ v8hi z5[] = { i, i }; -+ v8hi z6[] = { i, h }; -+ v8hi z7[] = { h, i }; -+ v8hi z8[] = { h, h }; -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/pr96377-1.c b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c -new file mode 100644 -index 00000000000..51e3e36edfc ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/pr96377-1.c -@@ -0,0 +1,20 @@ -+/* { dg-options "" } */ -+ -+#include -+ -+struct aegis128_state { -+ uint8x16_t v[5]; -+}; -+ -+void foo(const void *key, const void *iv, const void *const0, const void *const1) -+{ -+ uint8x16_t k = vld1q_u8(key); -+ uint8x16_t kiv = k ^ vld1q_u8(iv); -+ struct aegis128_state st = {{ -+ kiv, -+ vld1q_u8(const1), -+ vld1q_u8(const0), -+ k ^ vld1q_u8(const0), -+ k ^ vld1q_u8(const1), -+ }}; -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c -new file mode 100644 -index 00000000000..0f1a2b0e46b ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_3.c -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; // { dg-error "incompatible types" } -+ gnu_uint8_t arr3[] = { sve_s1 }; // { dg-error "incompatible types" } -+} -diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c -new file mode 100644 -index 00000000000..ac4e0d12ff8 ---- /dev/null -+++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/gnu_vectors_4.c -@@ -0,0 +1,15 @@ -+/* { dg-options "-msve-vector-bits=256 -flax-vector-conversions" } */ -+ -+#include -+ -+typedef uint8_t gnu_uint8_t __attribute__ ((vector_size (32))); -+typedef int8_t gnu_int8_t __attribute__ ((vector_size (32))); -+ -+void -+f (svuint8_t sve_u1, svint8_t sve_s1, -+ gnu_uint8_t gnu_u1, gnu_int8_t gnu_s1) -+{ -+ gnu_uint8_t arr1[] = { gnu_u1, sve_u1 }; -+ gnu_uint8_t arr2[] = { gnu_s1 }; -+ gnu_uint8_t arr3[] = { sve_s1 }; -+} --- -2.27.0 - diff --git a/cross/gcc-aarch64/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch b/cross/gcc-armv7/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch similarity index 92% rename from cross/gcc-aarch64/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch rename to cross/gcc-armv7/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch index 6c1eb03b9..25bb335d0 100644 --- a/cross/gcc-aarch64/0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +++ b/cross/gcc-armv7/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch @@ -1,7 +1,7 @@ -From 756d3163d2ee3ee21ad815ab6dfebe58e8c32965 Mon Sep 17 00:00:00 2001 +From 3d86ab883c2a67dc9828f73a3d84c9fdb202ec32 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:58:08 +0200 -Subject: [PATCH] gcc-go: Use _off_t type instead of _loff_t +Subject: [PATCH 29/39] gcc-go: Use _off_t type instead of _loff_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -43,3 +43,6 @@ index 88286c07b6e..f8f5cfb5011 100644 plwoff = &lwoff } n, err = splice(rfd, plroff, wfd, plwoff, len, flags) +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0032-gcc-go-Don-t-include-sys-user.h.patch b/cross/gcc-armv7/0030-gcc-go-Don-t-include-sys-user.h.patch similarity index 82% rename from cross/gcc-aarch64/0032-gcc-go-Don-t-include-sys-user.h.patch rename to cross/gcc-armv7/0030-gcc-go-Don-t-include-sys-user.h.patch index 897dd6ec3..8150bebb1 100644 --- a/cross/gcc-aarch64/0032-gcc-go-Don-t-include-sys-user.h.patch +++ b/cross/gcc-armv7/0030-gcc-go-Don-t-include-sys-user.h.patch @@ -1,7 +1,7 @@ -From ba9db3417c93a42dbf994e7c18c021f5542aa354 Mon Sep 17 00:00:00 2001 +From da63b5262701f91a2261812332f2850be0180634 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:58:21 +0200 -Subject: [PATCH] gcc-go: Don't include sys/user.h +Subject: [PATCH 30/39] gcc-go: Don't include sys/user.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -25,3 +25,6 @@ index 0692fd41eb7..c8d987358d9 100644 #if defined(HAVE_SYS_UTSNAME_H) #include #endif +-- +2.28.0 + diff --git a/cross/gcc-armv7/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch b/cross/gcc-armv7/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch deleted file mode 100644 index 8543681f6..000000000 --- a/cross/gcc-armv7/0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 773021143288f5bf0dca1e3ee1f908f580f6fd9c Mon Sep 17 00:00:00 2001 -From: Peter Bergner -Date: Thu, 13 Aug 2020 13:40:39 -0500 -Subject: [PATCH 30/30] rs6000: ICE when using an MMA type as a function param - or return value [PR96506] - -PR96506 shows a problem where we ICE on illegal usage, namely using MMA -types for function arguments and return values. The solution is to flag -these illegal usages as errors early, before we ICE. - -2020-08-13 Peter Bergner - -gcc/ - PR target/96506 - * config/rs6000/rs6000-call.c (rs6000_promote_function_mode): Disallow - MMA types as return values. - (rs6000_function_arg): Disallow MMA types as function arguments. - -gcc/testsuite/ - PR target/96506 - * gcc.target/powerpc/pr96506.c: New test. - -(cherry picked from commit 0ad7e730c142ef6cd0ddc1491a89a7f330caa887) ---- - gcc/config/rs6000/rs6000-call.c | 34 ++++++++++- - gcc/testsuite/gcc.target/powerpc/pr96506.c | 66 ++++++++++++++++++++++ - 2 files changed, 99 insertions(+), 1 deletion(-) - create mode 100644 gcc/testsuite/gcc.target/powerpc/pr96506.c - -diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c -index 243601e90c1..37566780e54 100644 ---- a/gcc/config/rs6000/rs6000-call.c -+++ b/gcc/config/rs6000/rs6000-call.c -@@ -6076,8 +6076,30 @@ machine_mode - rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, - machine_mode mode, - int *punsignedp ATTRIBUTE_UNUSED, -- const_tree, int) -+ const_tree, int for_return) - { -+ /* Warning: this is a static local variable and not always NULL! -+ This function is called multiple times for the same function -+ and return value. PREV_FUNC is used to keep track of the -+ first time we encounter a function's return value in order -+ to not report an error with that return value multiple times. */ -+ static struct function *prev_func = NULL; -+ -+ /* We do not allow MMA types being used as return values. Only report -+ the invalid return value usage the first time we encounter it. */ -+ if (for_return -+ && prev_func != cfun -+ && (mode == POImode || mode == PXImode)) -+ { -+ /* Record we have now handled function CFUN, so the next time we -+ are called, we do not re-report the same error. */ -+ prev_func = cfun; -+ if (TYPE_CANONICAL (type) != NULL_TREE) -+ type = TYPE_CANONICAL (type); -+ error ("invalid use of MMA type %qs as a function return value", -+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); -+ } -+ - PROMOTE_MODE (mode, *punsignedp, type); - - return mode; -@@ -7028,6 +7050,16 @@ rs6000_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) - machine_mode elt_mode; - int n_elts; - -+ /* We do not allow MMA types being used as function arguments. */ -+ if (mode == POImode || mode == PXImode) -+ { -+ if (TYPE_CANONICAL (type) != NULL_TREE) -+ type = TYPE_CANONICAL (type); -+ error ("invalid use of MMA operand of type %qs as a function parameter", -+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); -+ return NULL_RTX; -+ } -+ - /* Return a marker to indicate whether CR1 needs to set or clear the - bit that V.4 uses to say fp args were passed in registers. - Assume that we don't need the marker for software floating point, -diff --git a/gcc/testsuite/gcc.target/powerpc/pr96506.c b/gcc/testsuite/gcc.target/powerpc/pr96506.c -new file mode 100644 -index 00000000000..b1b40c5a5c8 ---- /dev/null -+++ b/gcc/testsuite/gcc.target/powerpc/pr96506.c -@@ -0,0 +1,66 @@ -+/* PR target/96506 */ -+/* { dg-do compile } */ -+/* { dg-require-effective-target power10_ok } */ -+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */ -+ -+extern void bar0(); -+extern void bar1(); -+extern void bar2(); -+extern void bar3(); -+ -+typedef __vector_pair vpair_t; -+typedef __vector_quad vquad_t; -+ -+/* Verify we flag errors on the following. */ -+ -+void -+foo0 (void) -+{ -+ __vector_pair v; -+ bar0 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */ -+} -+ -+void -+foo1 (void) -+{ -+ vpair_t v; -+ bar1 (v); /* { dg-error "invalid use of MMA operand of type .__vector_pair. as a function parameter" } */ -+} -+ -+void -+foo2 (void) -+{ -+ __vector_quad v; -+ bar2 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */ -+} -+ -+void -+foo3 (void) -+{ -+ vquad_t v; -+ bar3 (v); /* { dg-error "invalid use of MMA operand of type .__vector_quad. as a function parameter" } */ -+} -+ -+__vector_pair -+foo4 (__vector_pair *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */ -+{ -+ return *src; -+} -+ -+vpair_t -+foo5 (vpair_t *src) /* { dg-error "invalid use of MMA type .__vector_pair. as a function return value" } */ -+{ -+ return *src; -+} -+ -+__vector_quad -+foo6 (__vector_quad *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */ -+{ -+ return *src; -+} -+ -+vquad_t -+foo7 (vquad_t *src) /* { dg-error "invalid use of MMA type .__vector_quad. as a function return value" } */ -+{ -+ return *src; -+} --- -2.27.0 - diff --git a/cross/gcc-armhf/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch b/cross/gcc-armv7/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch similarity index 88% rename from cross/gcc-armhf/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch rename to cross/gcc-armv7/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch index 4584a3595..186e2d11b 100644 --- a/cross/gcc-armhf/0033-gcc-go-Fix-ucontext_t-on-PPC64.patch +++ b/cross/gcc-armv7/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch @@ -1,7 +1,7 @@ -From a2da9c892a6b29a8067f20fda2d8a5e9a7b5193e Mon Sep 17 00:00:00 2001 +From 18d6d2d1f62a4232340696fb7d68d248c751e416 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:59:22 +0200 -Subject: [PATCH] gcc-go: Fix ucontext_t on PPC64 +Subject: [PATCH 31/39] gcc-go: Fix ucontext_t on PPC64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,3 +24,6 @@ index b429fdb2403..fd1c885f043 100644 #elif defined(__PPC__) && defined(_AIX) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; #elif defined(__aarch64__) && defined(__linux__) +-- +2.28.0 + diff --git a/cross/gcc-armv7/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch b/cross/gcc-armv7/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch similarity index 92% rename from cross/gcc-armv7/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch rename to cross/gcc-armv7/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch index 528bbb3c2..2ecd0ca01 100644 --- a/cross/gcc-armv7/0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch +++ b/cross/gcc-armv7/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch @@ -1,7 +1,7 @@ -From 1d0cd9bbbef7d1bd3f42ad493db8d08b539cba60 Mon Sep 17 00:00:00 2001 +From d9942a2e54f69dee9c03e5e4339a6c62473e6845 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:59:45 +0200 -Subject: [PATCH] gcc-go: Fix handling of signal 34 on musl +Subject: [PATCH 32/39] gcc-go: Fix handling of signal 34 on musl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -38,3 +38,6 @@ index 11e4ec436bd..fe866eacb27 100644 fi if test "${GOOS}" = "aix"; then +-- +2.28.0 + diff --git a/cross/gcc-armv7/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch b/cross/gcc-armv7/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch similarity index 88% rename from cross/gcc-armv7/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch rename to cross/gcc-armv7/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch index 683242458..2234e32e5 100644 --- a/cross/gcc-armv7/0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +++ b/cross/gcc-armv7/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch @@ -1,7 +1,7 @@ -From 956c8cc94e7aa487eb142905c319487d94dc621d Mon Sep 17 00:00:00 2001 +From 38e7c12086acae4507f9d5067f947431a28c34db Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:01:03 +0200 -Subject: [PATCH] gcc-go: Use int64 type as offset argument for mmap +Subject: [PATCH 33/39] gcc-go: Use int64 type as offset argument for mmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -33,3 +33,6 @@ index ba38ebaa9ab..3c9e5ce9461 100644 p := sysMmap(addr, n, prot, flags, fd, off) if uintptr(p) == _MAP_FAILED { return nil, errno() +-- +2.28.0 + diff --git a/cross/gcc-armhf/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch b/cross/gcc-armv7/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch similarity index 88% rename from cross/gcc-armhf/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch rename to cross/gcc-armv7/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch index aa6849135..40c515ee8 100644 --- a/cross/gcc-armhf/0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +++ b/cross/gcc-armv7/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch @@ -1,7 +1,8 @@ -From c3a80843b7502ec2bfb5f1e5b514658c5f9dd884 Mon Sep 17 00:00:00 2001 +From a4e800081081b00539bbb6fd8b5cf6b66504cfaa Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:02:28 +0200 -Subject: [PATCH] gcc-go: Fix st_{a,m,c}tim fields in generated sysinfo.go +Subject: [PATCH 34/39] gcc-go: Fix st_{a,m,c}tim fields in generated + sysinfo.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -32,3 +33,6 @@ index bd2ba32cba1..972e2c379bc 100755 -e 's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g' \ -e 's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g' \ -e 's/\([^a-zA-Z0-9_]\)_st_timespec_t\([^a-zA-Z0-9_]\)/\1StTimespec\2/g' \ +-- +2.28.0 + diff --git a/cross/gcc-armhf/0037-gcc-go-signal-34-is-special-on-musl-libc.patch b/cross/gcc-armv7/0035-gcc-go-signal-34-is-special-on-musl-libc.patch similarity index 85% rename from cross/gcc-armhf/0037-gcc-go-signal-34-is-special-on-musl-libc.patch rename to cross/gcc-armv7/0035-gcc-go-signal-34-is-special-on-musl-libc.patch index 89228cf8b..f4046862d 100644 --- a/cross/gcc-armhf/0037-gcc-go-signal-34-is-special-on-musl-libc.patch +++ b/cross/gcc-armv7/0035-gcc-go-signal-34-is-special-on-musl-libc.patch @@ -1,7 +1,7 @@ -From 75e274b0819c9a77ca121113301d353f7aa91740 Mon Sep 17 00:00:00 2001 +From 57ccf0ad7f0c4b1f998ebfb6cdaa7d1876012d66 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 18:03:03 +0200 -Subject: [PATCH] gcc-go: signal 34 is special on musl libc +Subject: [PATCH 35/39] gcc-go: signal 34 is special on musl libc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -24,3 +24,6 @@ index c555712a03c..9e228580d37 100644 return _SIG_DFL } throw("sigaction read failure") +-- +2.28.0 + diff --git a/cross/gcc-armv7/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch b/cross/gcc-armv7/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch similarity index 85% rename from cross/gcc-armv7/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch rename to cross/gcc-armv7/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch index 3c21fedaf..08d9ca397 100644 --- a/cross/gcc-armv7/0038-gcc-go-Prefer-_off_t-over-_off64_t.patch +++ b/cross/gcc-armv7/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch @@ -1,7 +1,7 @@ -From ff096af4402ab87a61eb3979b47246a3a1b4fa38 Mon Sep 17 00:00:00 2001 +From e6d4cdd4d03cceb01e8ed03bbe7d35b5798abc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 30 Aug 2020 19:26:53 +0200 -Subject: [PATCH] gcc-go: Prefer _off_t over _off64_t +Subject: [PATCH 36/39] gcc-go: Prefer _off_t over _off64_t musl does not seem to have _off64_t. --- @@ -25,3 +25,6 @@ index 972e2c379bc..8d6da15f983 100755 echo "type Mode_t _mode_t" >> ${OUT} echo "type Pid_t _pid_t" >> ${OUT} echo "type Uid_t _uid_t" >> ${OUT} +-- +2.28.0 + diff --git a/cross/gcc-aarch64/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch b/cross/gcc-armv7/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch similarity index 81% rename from cross/gcc-aarch64/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch rename to cross/gcc-armv7/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch index 30995e582..c5e4806fe 100644 --- a/cross/gcc-aarch64/0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +++ b/cross/gcc-armv7/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch @@ -1,7 +1,7 @@ -From 56dc7cac03987e95915032161ff0f7d5a8b8bf36 Mon Sep 17 00:00:00 2001 +From ac54a2afa01a3ebb06346f8dac505f0babbbe1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 30 Aug 2020 19:27:51 +0200 -Subject: [PATCH] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c +Subject: [PATCH 37/39] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c --- libgo/runtime/proc.c | 4 ++++ @@ -22,3 +22,6 @@ index 274ce01c0bf..92a540bdde9 100644 #ifndef SETCONTEXT_CLOBBERS_TLS static inline void +-- +2.28.0 + diff --git a/cross/gcc-armhf/0040-gcc-go-link-to-libucontext.patch b/cross/gcc-armv7/0038-gcc-go-link-to-libucontext.patch similarity index 83% rename from cross/gcc-armhf/0040-gcc-go-link-to-libucontext.patch rename to cross/gcc-armv7/0038-gcc-go-link-to-libucontext.patch index de59e07f6..5a626f601 100644 --- a/cross/gcc-armhf/0040-gcc-go-link-to-libucontext.patch +++ b/cross/gcc-armv7/0038-gcc-go-link-to-libucontext.patch @@ -1,7 +1,7 @@ -From ead76eced040b588f9374646a188ba21abab2049 Mon Sep 17 00:00:00 2001 +From e456a63af7f0bd1f519de98e74f864be0f73572a Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 31 Aug 2020 08:59:40 +0200 -Subject: [PATCH] gcc-go: link to libucontext +Subject: [PATCH 38/39] gcc-go: link to libucontext --- Makefile.in | 2 +- @@ -20,3 +20,6 @@ index 63627db68cf..c7f1f84d683 100644 $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ +-- +2.28.0 + diff --git a/cross/gcc-armhf/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch b/cross/gcc-armv7/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch similarity index 83% rename from cross/gcc-armhf/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch rename to cross/gcc-armv7/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch index 406a74d00..b3568a511 100644 --- a/cross/gcc-armhf/0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch +++ b/cross/gcc-armv7/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch @@ -1,7 +1,8 @@ -From 3f5ee6a593215fbd40975d801ff37cf81a3fced3 Mon Sep 17 00:00:00 2001 +From f3a1e98d6d4d546bfb749b91c1f3639df905c1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Mon, 31 Aug 2020 20:26:56 +0200 -Subject: [PATCH] gcc-go: Disable printing of unaccessible ppc64 struct members +Subject: [PATCH 39/39] gcc-go: Disable printing of unaccessible ppc64 struct + members These struct members do not seem to exist on musl. --- @@ -21,3 +22,6 @@ index fd1c885f043..e845e453332 100644 { mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; int i; +-- +2.28.0 + diff --git a/cross/gcc-armv7/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch b/cross/gcc-armv7/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch deleted file mode 100644 index a3087c678..000000000 --- a/cross/gcc-armv7/0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 27a633f79c9a0248ce673ff2d9c397e136427b01 Mon Sep 17 00:00:00 2001 -From: None <@> -Date: Wed, 21 Oct 2020 17:35:50 +0000 -Subject: Backport of patch of the GCC 11 to avoid the GNU Attributes into - libgcc - -source: https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554770.html - -The -mno-gnu-attribute avoids the linker emit an error when check -the type of long double 128bit. - -Signed-off-by: Gustavo L F Walbon -Signed-off-by: Tulio Magno Quites Machado Filho ---- - main/gcc/t-float128 | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 -index d5413445..b4e1afab 100644 ---- a/libgcc/config/rs6000/t-float128 -+++ b/libgcc/config/rs6000/t-float128 -@@ -69,6 +69,17 @@ $(fp128_ppc_obj) : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW) - $(fp128_obj) : $(fp128_includes) - $(fp128_obj) : $(srcdir)/config/rs6000/quad-float128.h - -+# If we are switching the default long double type, we need to use -+# -mno-gnu-attribute so that the __ibm128 support functions don't signal a -+# linker error since the default long double is now IEEE 128-bit instead of IBM -+# 128-bit. -+ibm-ldouble$(objext) : INTERNAL_CFLAGS += -mno-gnu-attribute -+ -+CFLAGS_TF_DECIMAL = -mno-gnu-attribute -Wno-psabi -mabi=ibmlongdouble -+CFLAGS_KF_DECIMAL = -mno-gnu-attribute -Wno-psabi -mabi=ieeelongdouble -+CFLAGS_KF_DECIMAL_SW = $(CFLAGS_KF_DECIMAL) -mno-float128-hardware -+$(TF_DECIMAL_OBJS) : INTERNAL_CFLAGS += $(CFLAGS_TF_DECIMAL) -+ - $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep) - @src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \ - echo "Create $@"; \ --- -2.29.0 - diff --git a/cross/gcc-armv7/APKBUILD b/cross/gcc-armv7/APKBUILD index 05d2038c4..cd34320cf 100644 --- a/cross/gcc-armv7/APKBUILD +++ b/cross/gcc-armv7/APKBUILD @@ -24,13 +24,14 @@ CBUILDROOT="/" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" pkgname=gcc-armv7 -pkgver=10.2.0 +_pkgbase=10.2.1 +pkgver=10.2.1_pre0 [ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2" [ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname=gcc-armv7 -pkgrel=7 +pkgrel=0 pkgdesc="Stage2 cross-compiler for armv7" url="https://gcc.gnu.org" arch="x86_64" @@ -169,7 +170,11 @@ if $LANG_ADA; then fi makedepends="$makedepends_build $makedepends_host" -source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# when using upstream releases, use this URI template +# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# +# right now, we are using a git snapshot +source="https://dev.alpinelinux.org/~nenolod/gcc-10.2.1.tar.xz 0001-posix_memalign.patch 0002-gcc-poison-system-directories.patch 0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -198,28 +203,25 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg 0026-always-build-libgcc_eh.a.patch 0027-ada-libgnarl-compatibility-for-musl.patch 0028-ada-musl-support-fixes.patch - 0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch - 0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch - 0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch - 0032-gcc-go-Don-t-include-sys-user.h.patch - 0033-gcc-go-Fix-ucontext_t-on-PPC64.patch - 0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch - 0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch - 0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch - 0037-gcc-go-signal-34-is-special-on-musl-libc.patch - 0038-gcc-go-Prefer-_off_t-over-_off64_t.patch - 0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch - 0040-gcc-go-link-to-libucontext.patch - 0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch - 0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch + 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch + 0030-gcc-go-Don-t-include-sys-user.h.patch + 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch + 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch + 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch + 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch + 0035-gcc-go-signal-34-is-special-on-musl-libc.patch + 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch + 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch + 0038-gcc-go-link-to-libucontext.patch + 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch " # gcc-4.8-build-args.patch # we build out-of-tree _gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver} -_gcclibdir="/usr/lib/gcc/$CTARGET/$pkgver" -_gcclibexec="/usr/libexec/gcc/$CTARGET/$pkgver" +_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}" +_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}" prepare() { cd "$_gccdir" @@ -242,7 +244,7 @@ prepare() { return 1 fi - echo ${pkgver} > gcc/BASE-VER + echo ${_pkgbase:-$pkgver} > gcc/BASE-VER } build() { @@ -648,46 +650,43 @@ gnat() { mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/ } -sha512sums="42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e gcc-10.2.0.tar.xz -ee2d344e912ebaddf71d53ff674ca7ea7837ee65f982a8f088339fd05261e441aace6087f7f936d32b502bff7e375094f48cb90562ab7734c57e1750d3fe2029 0001-posix_memalign.patch -deaf3ba25614df18b2b9b04244bcc9278c16d98f6fdeac17f7e2c0567be7c2836ab6d21fc9d8f779c672022d25fc278327d6d0d637bc200fadbb8d913ef95581 0002-gcc-poison-system-directories.patch -eb80ea94e008e33b97c8c0d47e74d639897a13357abbd130e9bff4ae30349b8f788acbaf4caa61f23022a86841c431b8bb639c536aab548dc735470a7c7ccfcf 0003-Turn-on-Wl-z-relro-z-now-by-default.patch -6cbc39dd24f7b4316b6e69940bf7c9f3ae889e8156f9c7dd72c8335e55a2a44d6fade37954296451b588bf8fc065514d4916ad527042b8f9a86d6e0d706e3c9c 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch -e8c75aef864e5852fc78bfd7949232fc58b40a743d7c04a122ee6e021ee99f72edcff6efbf74e0eedc9405faf81d01208867b0571c4dc8cb44b9a03d1d25fbde 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch -d5b3d40e1c4828d16684137487f64bf0b4b892fabc403f975f37d481a22647f923a3524a12714898937abdfbf875411e50b522134535f8d1852f103310aef5a3 0006-Enable-Wformat-and-Wformat-security-by-default.patch -e568a17fb3348964c0d21e7d67ffeae4f2f0dfd3f2986aaf9cec86c685c13f0c830dfc019b6bd7fe58b8635e5b8fca7ad992a92210f2be285b8cac6467c33a78 0007-Enable-Wtrampolines-by-default.patch -fd47150c72138d47a9faafe8586e84456e09a4ca0ed1ba9be7b5b2a351b1ca2d17b238beaa42c88888402d181933ff68cef0a91f0c3bd26d374706cf71726bbd 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch -820be83d93ff5b8d8fc69cdeccec0c6ac2544ee6cce43ae35e6829222791733a1c0b2232fb5a7ad93ab9e6cd677f077d01a4f9dec7aa9c38b013f74aa6c74fc3 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch -5be4c0ad27e3b86c06dcaefe34ee1271cb53ded3de9802bc1a8571497240ca870e22534f77adb52dc4556eb4861b94a6c9a39cf6a2e84ef62ee88a04a4a01868 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch -5024309e549b7e4a94f2af8bd727144bd27cf8b7cdcbb537a30f3dac28543697c214438da7af491e43cb90daac46344b7b0466729d5c4209ca8a3a0d5a7d027c 0011-libiberty-copy-PIC-objects-during-build-process.patch -c0ebc205f6598edbe6d68b8a287c36ef80826b864e5b92b37f64e7a21ab7048cae67dd5650cd3d1399beb890753ad96e898a94c52d13b3ca7b266a15fed043ca 0012-libitm-disable-FORTIFY.patch -4a4fae02231f49142ab90d4f3dcd093c13032781ff1659f6aca62da13f8c676e2ec9dcdd2e7959ec62835e13c515be9bd7a2e35d3c06768d44d9e1185cb40dac 0013-libgcc_s.patch -9c513a30146364ecd899ca26a27019ea1ba353e8e409e0becb50d2a051022b701586b9276a4f118dbdd131c4882a04cad4188219bb10aa36d7b0bbe2eb2ceb03 0014-nopie.patch -aec141251c3abae35b4dc3ecd3778e332fa5596282fea1fd08c8d5350d8a8740568910236ce8d38c5662232fa5412313cb0a1c7a46c79a5b5e2c643871bf643b 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch -d3fc4ea6918b4c4ce57eb45437f88ec3982bd5c8e17d282003e195dc705e0c84996ec140151b2b2371917595d2d62f30a2cb4676150c1bc8b8fd3b8fb85ecbe9 0016-dlang-update-zlib-binding.patch -4ebf845f41c7a8ba5bfa624c8e1527eb0f15a48d6a8bd151435037bd4b9d71f955ac9b60ab453c0315d592e92f194be92b9c3fca40ed533d64c0a1995c3ad4be 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch -2ca085382a03d269a2f48ec49601328cec7c53eb69856ee55aea11610293c206e8881043030d2295f49a08a5897c9eb9a6126a5ae65edbd967e17e34dadfb2d8 0018-ada-fix-shared-linking.patch -307a1ac2a6cea20c900b7bef2d5d7ad98c2b8cc45bdb2a6adbf151f3228d5de2670c75ddf48e4d3c9ceb7ed42852e24be534773551bc050ad10005faaee2600c 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch -d01d0031d97fa42363bd3fb0c0dda9b26e7f06660294f0ceec55624f6564f2ce372b9a255683c67d79dfa18fb8551416c04766debc2e1b9c587ef381eef64f0b 0020-libstdc-futex-add-time64-compatibility.patch -e9eb5ff439cff4a22abaa7b9e27a176b51e1e1f4361fd829bd26e4b5ffc0e4583b1d6728b1510991b069b42f0aae8a2e698f85edecb1d792e4c7e10079507de8 0021-add-fortify-headers-paths.patch -beb7aa26a3731855be2521495186af52d4764973f2bc1ad44554332e867fe52fa37bcb5747395e44ae0011413e702054a60a754ad81dd88bbf97e3c7c718f356 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch -ac3288b7840e5cf2500608773f40e604798b30fcb885c9fec7ba0bcc4bcfd374211faa26e82fcf4669bf624d5ccb0bdc747897759be77af3621b8b3bb08bff85 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch -7e953227e0d3f1105a754f3fdefbaaca0b106d337c5bcc9b6394712d7f47173f96906517030b508d5a57611cc637848f2e59aec92313b39f1e2221bd98729826 0024-Pure-64-bit-MIPS.patch -12eaad6a8781e76f38bc4ba5c8cd09cfe0a0b95c0cde83fe58dc10bdec542fe43389f2c84bd313629c45af8ed3ffd46cc4478f5a4152ea1eb8d4b8276ede499c 0025-use-pure-64-bit-configuration-where-appropriate.patch -73a649ac371f4a5da68c5f0b88010080efd7deaee29765ef7a299fd1654b5ccdbfee88c59e5d37ae55e37cf6fa218d989e411c04b17e0fd94268ed65d7dcd4bf 0026-always-build-libgcc_eh.a.patch -59d9e0a5f39ad68b8bb1365f7c97a54ca4751cdad01ead8184fd897d8a13156145976a8b5b9856be154c053d6ba11eaad1e5662e7ddda9ba6d2811340df61cba 0027-ada-libgnarl-compatibility-for-musl.patch -8207323c530929517c799b24b1a7ba39c07bbb0e6770f878f1d66088ae16667e7706c9402ac04fe5eb6447a6ad12b548cc7e7612c5b217cd24e7d00094d2a28f 0028-ada-musl-support-fixes.patch -b90f7ad074b6183a4afc6be65349b8bf94b78d1c259d5be9877c16e3de95222fb6905cba7eb6ee4fe1e564ed20bf183c6815bd087896b6b0376656a841736fc1 0029-c-Fix-bogus-vector-initialisation-error-PR96377.patch -39a66708fb7ab4a72e1973749e32c22484e8e6c0afde6a59a645f2536c71cea86c8de2f0448621d53888293121344e84a24617400fae849282df57e0f5ddc21d 0030-rs6000-ICE-when-using-an-MMA-type-as-a-function-para.patch -ae0d860324b8b907ff82fcebe4777afae19df85b091723ac55425d24f677fb4e1d14ff4f21cdcdf837dcf730a4c48174e0cc31d1d003a5d11a88c226d5ed3e4a 0031-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch -a08ea6ce516dc96029153de096b96dcd3262509ee546f1f03152abe8f78c11c75b8dc14de39ccd982896114bf33d2edade2b4810dcc0b2d68e4abf52b67b8a41 0032-gcc-go-Don-t-include-sys-user.h.patch -3bbd3ab3d31fc81cbc6b641919a84807e52b59794f860cad83b9ff69bfd0f5f29aeefc5f19b203bc96db23bf6e5a6958690bd81caa3137eaa5111b5c465273b3 0033-gcc-go-Fix-ucontext_t-on-PPC64.patch -9c410c3a137a18559f1ae5ab5803d5bc8fc596a93da769b4ff2feec516602eb193333d18d55ce39e054b56726a5c243962e8ccdee001ae7e186b4222465b31a3 0034-gcc-go-Fix-handling-of-signal-34-on-musl.patch -78af84111854f5d2de127f03fc0984ea1f9c2c87156be2c454cc88a6791c90817aed63aba2861657560b1d3bc182a31e3d74f7a946e56d831939870240625fb7 0035-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch -c0d47b5bc478b3e0943806806d81a9183b9d176148e31c75d50cdbb23a34d9c178d751a3fac743d94ebb44c7eae70d3c55ca115acedcf4a1a0bacf46c0c5cd5f 0036-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch -e9b523a34b5e2930e0c58ee19e903e5416fe65641df80c40937d445d4c8f4f4bde59b3a94a392f5ca0d1c4a87565bd655c186b3a5194cb5bce4de2864d5d025d 0037-gcc-go-signal-34-is-special-on-musl-libc.patch -d75147c2b062b0321b36d843c55887673d8bdac6448da465c29853ac5df3b68153551913476f2ea0fdb6d09df3992e47d457e480b3c16d99e6668b4f941e6e16 0038-gcc-go-Prefer-_off_t-over-_off64_t.patch -a60d2101f49d921cb538fd46650ba550f30721650b40e15fe8a56da32e5f2a3ea62f10d93982ffb45bee2e284cc006141b5d7a96fa12215d63b183b0a67c4c55 0039-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch -f08cfc9622e84a5a527b626dcca7199a430ab1c02588fef718bcb0155bc5af5a11888aa975e76e55cc2b9b70520a8bf1bcf939e5afe073f6263685686bc9c26f 0040-gcc-go-link-to-libucontext.patch -f27644461c8a3fd27026873639608e53a396e9b9d39c4f330c8eeba82bb9b1e68ae1bfb82c770424399a13762bb3ec147b2699b2cbbdca07628ab3896d806ce4 0041-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch -32f66f2886448206e216cdabcfd775f378a9fb879e0d0455cec7aec5b5004405175700736f4b48f3c364eab571b1561804b952f0a998103249ef94221bdf8ceb 0042-Backport-of-patch-of-the-GCC-11-to-avoid-the-GNU-Att.patch" +sha512sums="30c3e36c6e001d172b6219dbf5f0383655d29cbed8a197e1d6139213aacbfdb7cbca63553eedf3a4b35bd445a87ee0f555838d8b2cd7a46ab6bba7951a6b60c5 gcc-10.2.1.tar.xz +571e689369e1fd8a9281fed29f9ce5d35cdb6f892f5118216b2b171c5cd16ba5ab1f8f25f8438760bd26bc649b8f4703cc4e7a0918c250933398a37132fb3266 0001-posix_memalign.patch +2ca7d07543105955525e28a899f9cfbafa3f4f58cce8ae9931c20ddebe1126119a5001b8654e3ff7762f84de882dd609ae87f987b31a53dba6d6f5c7b6374a81 0002-gcc-poison-system-directories.patch +772b1bbae7c12cecef87d696603c523d5ea94a6c27f020f5873e6011479e43af735690a1137d4ec2a086946460ce4d411d5a9f00491015a73b04df39942d6dcd 0003-Turn-on-Wl-z-relro-z-now-by-default.patch +5d785525371fdfe89c5c36edf8c694083fc5d25870ef529473386de51e1db2f846d55a48087099230028acc1d076ad29c159603249aedc695cdf14844e2b26c7 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +f467e975f904c01339696f27113ddccac321ef205db4855d46a2a7e9f4ec93e5ab5f9adc19e36a4ef6f61e87fcf9b089ea0727f3ea9736561fb4e9eec4bbf9b0 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +49919bcbd59aea56be90e209d299ddb7b7a295d1db438a769279f4fe57ccf7a028a68227e31a22c1370037a4946a4c7c9ed5ac5044c163fb0f3795d3a2dc26cd 0006-Enable-Wformat-and-Wformat-security-by-default.patch +8374eaa22ef5f26d63226ded57042a8d7d2b69b415e3ff87ec2fc5046404dc062e2e096f329062d047d4e741ed2c5b58b6e1695cf070308f36c9558c6098fdcc 0007-Enable-Wtrampolines-by-default.patch +6be0db2455f5f678d37506773e4493a3cbaefd951486edb3374803813c749c2e6064218950cdc1c06f491fd95d4bd6ae9cbdf83148b332d172c20903eca03aa1 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +d1d1a87177623439a929b42af57a997b48d9e1f6a4ff06b4f84c5f027fc461473dd36145671d2d61b50c0acfcf028d3361be9c95b3340e6e336b012de84f4252 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +167cc80faa6a9daca1a990e87bfc268f27cb620fcd488405f24e397b9a1d6f51a0238d85be4a87f2db93fc1e06ff05d569ce0a2e2fe4db65ec44e15dfb66b994 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +85327918c409bf982c0dc13895324d6fc9cef1c68a3969ba5cf0a9450f2a04e3fa858af5ef7e432fc578cf6b0631cec55921bdcd361724c928eea943b4b5b2f3 0011-libiberty-copy-PIC-objects-during-build-process.patch +f65784f4eebec688f51598a306b9d034ba7feb0c6ac35a45e4f59585097fff820b3de90613941603985cdb5ee1a4c630381146bf2ee8429ffe80f0ffd5aa22c1 0012-libitm-disable-FORTIFY.patch +c489306880b493c92796e145dad372976ff90e42d8a97211e91db59bc75ca20244c96456dc806fd30f878f95878a37f4211f58b0f527b5808467a245186a0e14 0013-libgcc_s.patch +67a045fb5588eeb6776a98fbc0280a97e8b06e26909cab3e55346f6c81d87cf9ed7515afa3648b92ddd455e182fd5e44f6094e44f701676817f9d6fc3aad319e 0014-nopie.patch +b559a0f380065bd62d69359813e855819950a82c2361aa85771081de68bfe5d652936fbe5ad762f029016c643ffc8d62c0bf0e90460bd7d62a1c0f89ddcb5491 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +a42d56b0346208adb4a9f8575d53519c6303ead4eb498bed2ff36b9c20d904d9e1ba5996ec8ee35fb39ba91f30be28a6ab6c3c537a21078670c3ae88762b9a5b 0016-dlang-update-zlib-binding.patch +72313fd4829c8d153b8f4654863ff959597ac25fe657d641cfb5eafb42ae58662dd8581ac7a09eb6dadd2797e3585376fdd1f0207f23c061febdc37a85ea1ba1 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +8f695b5f60d2effca4144373fb0e2d3f1ce4a0c4465669ffb3dd771794b0e18da73b2c3e3644403e91c786ad0c42b54bfeac22543280d40c1a1c2b441c434410 0018-ada-fix-shared-linking.patch +c6800ce569e2da9a379bbb94f1f064833ba66ea1e4dc555e66c45f4ab9e83f40264ca0d06d161df469449b05ddf04907f890b39a1fa8a2bc3e530777d4896371 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +5557ec2a754cd64451a8f186397ff79c509d5781a3e32ba11e6ea45356b13d28ba0b959663540d25725e4bd20934c029a90343bed03b2c0bd143ea73c7f47281 0020-libstdc-futex-add-time64-compatibility.patch +1844d044b1eb3cc72ef72c7efb0623d08d62bbb059dcc254524a378bcc37193126eb52894f6acfea31240457e51c435e28573346d3a19d3d045d12846c07ff8d 0021-add-fortify-headers-paths.patch +210b6a16411c1e5fd00c96c06472c3b7713417ef6f48ea8d127482664d63db8ff5226be2cb2b93420e5f153d96b48e02ba4937d2ad7172c6a0e52ac91a050a2d 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +4a1daeb55c1103b9b52061eb08a3782307e4c9e1a72f4fc20aaa1ecca02931a9678d6a71cbcf8aaf8898da4c95ad639f8d04de07f169d95c16fc58d0db31602e 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +80729605dac33f225eebecbcf6c319e2839c6924483a13bc186092f15f325bf3e972f68328546e394d9e216de0b00e6601ba768b0bb2633ff8c3c0747bb7b1fd 0024-Pure-64-bit-MIPS.patch +ba222bd9ceb95ea9aa729618b95ee81299d20dd5a7840bff47a046d92247e1ea9e2f65d192b1570724da5898fa950a0b8692d505b5c27005d4b143301fd86a52 0025-use-pure-64-bit-configuration-where-appropriate.patch +67e4426be0aeab6b62d7b5e72443f4ea71e4f3fab096b734d656601ad47d44120ef1d9fc87dfef6af2808b39d21cc161cf3d3e45744bd79b56a1071bef5cde94 0026-always-build-libgcc_eh.a.patch +1f9a62459a511a97620147b357a8d1129d1f33a45b3db3a16e049e33b62c23886c37b10152254e84a86d0d2736de06e68e029cf96fa607cf52f15d58e4925b94 0027-ada-libgnarl-compatibility-for-musl.patch +d610a309aebc1aa3a13ce57a69a185b129b02e34cac0f25d7ea3b1dde28551de5e0acc8952b7c877d1f63cbf8f245fb78555d41fee6a55d4d5f68fe92b6a3037 0028-ada-musl-support-fixes.patch +dfa4e5da6206793c63cffef67cf02a443116e63649e6b0466d3c6e24082e5f14eb2640fb9b1b433d2cc4d4755804a360b1b4c572f50638f27169c9f2ef271bdc 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +22aec9116a2dc32add10efcf6bdc502933a318c668aaa9f01d9e7d6aebc1221fd8e6858abd610c556582f9cad0bc15ff7fbb08ca6c7fbe483c481cec3f361712 0030-gcc-go-Don-t-include-sys-user.h.patch +274b227d5d28e9c1d90ce1e29d5d88f938ea775cdd536bd51c8941a55994103ffb37222e395ab36b2fe4676aef106bb63bd510f73590e2ae434f4c6904454363 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch +3c06cf909d3b07a7de89c67afa6596fdc4ed4445ddc299d3b037dab8cb08828726aa7136576ba6b36f4c8b80451215bc356c8f9141b1e1420010f1ad5444943f 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch +f0b6f30c6d934c751ab5d58f3656ab80e02ceac12954a124600b09f2de350ad5a2081a09c2eb5c046fe1969af5022ac27b3bc0c0652cd1986b402334825ca92d 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +7800ae263f8510341cfc4b0daf5771e309f8ac1df9b8b9ad199eb6c792a13d1550f59584a89eda396514692e43940f5f52039cdef64f49a3e1b9ef40282d81be 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +33ae7f190b29667d2740e5f8edb6e69946f5601c3d87e2874cb7314bdfaef798223c018006a1d1932a547d1139ebbce08c3cb8b5f563413eb2ae64b9b8668a1e 0035-gcc-go-signal-34-is-special-on-musl-libc.patch +5f56cecf4b1a00c47c58d75ac8390009d80c8733e63cda90483cbbcb2e89d4e63778e475292378df77e6d2b81603dc43f27b8bb9a36ea384a429f501e6e88eed 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch +a4d3396a34e88723740fe52451992082974ddd2336257d173726f08955806349cbee9ddf1d9ec634365d374a0d61f6b28496ca326fba007b151bc3bed3097fa6 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +85e1f94113cf9e6be00be810b484b2098913ddb6b9f088351e0ae4d96afe5782d7c8687dacda1db8ee7487d14f67ef836bcfe890e94221b6c112c587e373afe0 0038-gcc-go-link-to-libucontext.patch +d332bf5b2af982776aacee359737145b636eaf373214fc58f66666ec6add5032ae1d2cbff6380c0791a0a8010f3c73a68407cd8908385a9bb2ba0295ea3e2370 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch" diff --git a/cross/gcc-x86_64/0001-posix_memalign.patch b/cross/gcc-x86_64/0001-posix_memalign.patch new file mode 100644 index 000000000..826200e09 --- /dev/null +++ b/cross/gcc-x86_64/0001-posix_memalign.patch @@ -0,0 +1,42 @@ +From 4ed2cc3054f444c683f54954c32e586a54066337 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Fri, 26 Jan 2018 20:32:50 +0000 +Subject: [PATCH 01/39] 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 87344d9383f..ece428df487 100644 +--- a/gcc/config/i386/pmm_malloc.h ++++ b/gcc/config/i386/pmm_malloc.h +@@ -27,12 +27,13 @@ + #include + + /* We can't depend on since the prototype of posix_memalign +- may not be visible. */ ++ may not be visible and we can't pollute the namespace either. */ + #ifndef __cplusplus +-extern int posix_memalign (void **, size_t, size_t); ++extern int _mm_posix_memalign (void **, size_t, size_t) + #else +-extern "C" int posix_memalign (void **, size_t, size_t) throw (); ++extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw () + #endif ++__asm__("posix_memalign"); + + static __inline void * + _mm_malloc (size_t __size, size_t __alignment) +@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment) + return malloc (__size); + if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4)) + __alignment = sizeof (void *); +- if (posix_memalign (&__ptr, __alignment, __size) == 0) ++ if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0) + return __ptr; + else + return NULL; +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch b/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch new file mode 100644 index 000000000..6dec763f8 --- /dev/null +++ b/cross/gcc-x86_64/0002-gcc-poison-system-directories.patch @@ -0,0 +1,203 @@ +From 09a32a40b34477cd787deb12833c063a09dea7b2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:59:00 +0400 +Subject: [PATCH 02/39] gcc: poison-system-directories + +Add /sw/include and /opt/include based on the original +zecke-no-host-includes.patch patch. The original patch checked for +/usr/include, /sw/include and /opt/include and then triggered a failure and +aborted. + +Instead, we add the two missing items to the current scan. If the user +wants this to be a failure, they can add "-Werror=poison-system-directories". + +Signed-off-by: Mark Hatle +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/common.opt | 4 ++++ + gcc/config.in | 6 ++++++ + gcc/configure | 16 ++++++++++++++++ + gcc/configure.ac | 10 ++++++++++ + gcc/doc/invoke.texi | 9 +++++++++ + gcc/gcc.c | 2 ++ + gcc/incpath.c | 21 +++++++++++++++++++++ + 7 files changed, 68 insertions(+) + +diff --git a/gcc/common.opt b/gcc/common.opt +index dfed6ec76ba..8bb65e0e1af 100644 +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -682,6 +682,10 @@ Wreturn-local-addr + Common Var(warn_return_local_addr) Init(1) Warning + Warn about returning a pointer/reference to a local or temporary variable. + ++Wpoison-system-directories ++Common Var(flag_poison_system_directories) Init(1) Warning ++Warn for -I and -L options using system directories if cross compiling ++ + 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 364eba47737..9551c0dfdf9 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -224,6 +224,12 @@ + #endif + + ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++#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 b4088d8fd1e..793530e21cf 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -1010,6 +1010,7 @@ with_system_zlib + enable_maintainer_mode + enable_link_mutex + enable_version_specific_runtime_libs ++enable_poison_system_directories + enable_plugin + enable_host_shared + enable_libquadmath_support +@@ -1766,6 +1767,8 @@ Optional Features: + --enable-version-specific-runtime-libs + specify that runtime libraries should be installed + in a compiler-specific directory ++ --enable-poison-system-directories ++ warn for use of native system header directories + --enable-plugin enable plugin support + --enable-host-shared build host code as shared libraries + --disable-libquadmath-support +@@ -30271,6 +30274,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi ++ + # Substitute configuration variables + + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 070b9c6c497..0fd438e39e5 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -6605,6 +6605,16 @@ 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]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system header directories]) ++fi ++ + # Substitute configuration variables + AC_SUBST(subdirs) + AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 0d532a64bfe..86e57038042 100644 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}. + -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol + -Wparentheses -Wno-pedantic-ms-format @gol + -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol ++-Wno-poison-system-directories @gol + -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol + -Wrestrict -Wno-return-local-addr -Wreturn-type @gol + -Wno-scalar-storage-order -Wsequence-point @gol +@@ -6926,6 +6927,14 @@ made up of data only and thus requires no special treatment. But, for + most targets, it is made up of code and thus requires the stack to be + made executable in order for the program to work properly. + ++@item -Wno-poison-system-directories ++@opindex Wno-poison-system-directories ++Do not warn for @option{-I} or @option{-L} options using system ++directories such as @file{/usr/include} when cross compiling. This ++option is intended for use in chroot environments when such ++directories contain the correct headers and libraries for the target ++system rather than the host. ++ + @item -Wfloat-equal + @opindex Wfloat-equal + @opindex Wno-float-equal +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 9f790db0daf..b2200c5185a 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -1041,6 +1041,8 @@ proper position among the other output files. */ + "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ + "%X %{o*} %{e*} %{N} %{n} %{r}\ + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ ++ %{Wno-poison-system-directories:--no-poison-system-directories} \ ++ %{Werror=poison-system-directories:--error-poison-system-directories} \ + %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \ + VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ + %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ +diff --git a/gcc/incpath.c b/gcc/incpath.c +index 8a2bda00f80..9098ab044ab 100644 +--- a/gcc/incpath.c ++++ b/gcc/incpath.c +@@ -26,6 +26,7 @@ + #include "intl.h" + #include "incpath.h" + #include "cppdefault.h" ++#include "diagnostic-core.h" + + /* Microsoft Windows does not natively support inodes. + VMS has non-numeric inodes. */ +@@ -393,6 +394,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + } + fprintf (stderr, _("End of search list.\n")); + } ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (flag_poison_system_directories) ++ { ++ 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); ++ } ++ } ++#endif + } + + /* Use given -I paths for #include "..." but not #include <...>, and +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch b/cross/gcc-x86_64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch new file mode 100644 index 000000000..ab9cc6d94 --- /dev/null +++ b/cross/gcc-x86_64/0003-Turn-on-Wl-z-relro-z-now-by-default.patch @@ -0,0 +1,39 @@ +From 77e75a23e9bdf8863823225567c509b6fed49e6e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:45:49 +0000 +Subject: [PATCH 03/39] Turn on -Wl,-z,relro,-z,now by default. + +--- + gcc/doc/invoke.texi | 3 +++ + gcc/gcc.c | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 86e57038042..87ff404bc20 100644 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -14645,6 +14645,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the + linker. When using the GNU linker, you can also get the same effect with + @option{-Wl,-Map=output.map}. + ++NOTE: In Alpine Linux, for LDFLAGS, the option ++@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}. ++ + @item -u @var{symbol} + @opindex u + Pretend the symbol @var{symbol} is undefined, to force linking of +diff --git a/gcc/gcc.c b/gcc/gcc.c +index b2200c5185a..625c9ab7902 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -1039,6 +1039,7 @@ proper position among the other output files. */ + "%{flto|flto=*:% +Date: Fri, 21 Aug 2020 06:46:22 +0000 +Subject: [PATCH 04/39] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, + ObjC, ObjC++, if the optimization level is > 0 + +--- + gcc/c-family/c-cppbuiltin.c | 4 ++++ + gcc/doc/invoke.texi | 6 ++++++ + 2 files changed, 10 insertions(+) + +diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c +index db91a36794a..ed976c71404 100644 +--- a/gcc/c-family/c-cppbuiltin.c ++++ b/gcc/c-family/c-cppbuiltin.c +@@ -1385,6 +1385,10 @@ c_cpp_builtins (cpp_reader *pfile) + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); + ++ /* Fortify Source enabled by default for optimization levels > 0 */ ++ if (optimize) ++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); ++ + /* Misc. */ + if (flag_gnu89_inline) + cpp_define (pfile, "__GNUC_GNU_INLINE__"); +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 87ff404bc20..01e67e97491 100644 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -9230,6 +9230,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. + ++NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is ++set by default, and is activated when @option{-O} is set to 2 or higher. ++This enables additional compile-time and run-time checks for several libc ++functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or ++@option{-D_FORTIFY_SOURCE=0}. ++ + @item -O3 + @opindex O3 + Optimize yet more. @option{-O3} turns on all optimizations specified +-- +2.28.0 + 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 new file mode 100644 index 000000000..b60112aa3 --- /dev/null +++ b/cross/gcc-x86_64/0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch @@ -0,0 +1,269 @@ +From 483912c560424ee8b5cc996990d45802671fc73f Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:46:56 +0000 +Subject: [PATCH 05/39] 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 + + gcc/config/alpha/linux-elf.h | 2 +- + gcc/config/arm/linux-elf.h | 1 + + gcc/config/gnu-user.h | 6 +++--- + gcc/config/i386/gnu-user.h | 2 +- + gcc/config/i386/gnu-user64.h | 1 + + gcc/config/ia64/linux.h | 2 +- + gcc/config/mips/gnu-user.h | 1 + + gcc/config/riscv/linux.h | 1 + + gcc/config/rs6000/linux64.h | 4 ++-- + gcc/config/rs6000/sysv4.h | 2 +- + gcc/config/s390/linux.h | 2 +- + gcc/config/sparc/linux.h | 2 +- + gcc/gcc.c | 28 ++++++++++++++++++++-------- + 14 files changed, 36 insertions(+), 19 deletions(-) + +diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h +index e587e2e9ad6..1d1017aa523 100644 +--- a/gcc/config/aarch64/aarch64-linux.h ++++ b/gcc/config/aarch64/aarch64-linux.h +@@ -35,6 +35,7 @@ + #define CPP_SPEC "%{pthread:-D_REENTRANT}" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ ++ --as-needed \ + %{static:-Bstatic} \ + %{shared:-shared} \ + %{symbolic:-Bsymbolic} \ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index e25fcac3c59..22b2f7b0d14 100644 +--- a/gcc/config/alpha/linux-elf.h ++++ b/gcc/config/alpha/linux-elf.h +@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see + + #define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER + +-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \ ++#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax} \ + %{O*:-O3} %{!O*:-O1} \ + %{shared:-shared} \ + %{!shared: \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index 0ec3aa53189..f8bda84de2a 100644 +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -70,6 +70,7 @@ + %{rdynamic:-export-dynamic} \ + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ + -X \ ++ --as-needed \ + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC + +diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h +index ff2e880b1fa..7f30c363e4a 100644 +--- a/gcc/config/gnu-user.h ++++ b/gcc/config/gnu-user.h +@@ -136,17 +136,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \ + "%{static-libasan:%{!shared:" \ + LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \ +- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}" ++ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}" + #undef LIBTSAN_EARLY_SPEC + #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \ + "%{static-libtsan:%{!shared:" \ + LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \ +- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}" ++ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}" + #undef LIBLSAN_EARLY_SPEC + #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \ + "%{static-liblsan:%{!shared:" \ + LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \ +- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}" ++ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}" + #endif + + #undef TARGET_F951_OPTIONS +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index ae4aa844f02..54b91c0492a 100644 +--- a/gcc/config/i386/gnu-user.h ++++ b/gcc/config/i386/gnu-user.h +@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. If not see + { "link_emulation", GNU_USER_LINK_EMULATION },\ + { "dynamic_linker", GNU_USER_DYNAMIC_LINKER } + +-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ ++#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \ + %{!shared: \ + %{!static: \ + %{!static-pie: \ +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index 785c68220b8..21dd66b412a 100644 +--- a/gcc/config/i386/gnu-user64.h ++++ b/gcc/config/i386/gnu-user64.h +@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \ + %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \ + %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \ ++ --as-needed \ + %{shared:-shared} \ + %{!shared: \ + %{!static: \ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index ee38e218aec..0325971d818 100644 +--- a/gcc/config/ia64/linux.h ++++ b/gcc/config/ia64/linux.h +@@ -58,7 +58,7 @@ do { \ + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2" + + #undef LINK_SPEC +-#define LINK_SPEC "\ ++#define LINK_SPEC " --as-needed \ + %{shared:-shared} \ + %{!shared: \ + %{!static: \ +diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h +index 5d0782100bb..4be5fbb2191 100644 +--- a/gcc/config/mips/gnu-user.h ++++ b/gcc/config/mips/gnu-user.h +@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see + #undef GNU_USER_TARGET_LINK_SPEC + #define GNU_USER_TARGET_LINK_SPEC "\ + %{G*} %{EB} %{EL} %{mips*} %{shared} \ ++ -as-needed \ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h +index 4afef7c228c..ba1a6e60e05 100644 +--- a/gcc/config/riscv/linux.h ++++ b/gcc/config/riscv/linux.h +@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see + "%{mabi=ilp32:_ilp32}" + + #define LINK_SPEC "\ ++-as-needed \ + -melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \ + %{mno-relax:--no-relax} \ + %{shared} \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 2ded3301282..a1e44ddcc0d 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -457,13 +457,13 @@ extern int dot_symbols; + " -m elf64ppc") + #endif + +-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \ ++#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \ + %{!static-pie: \ + %{rdynamic:-export-dynamic} \ + -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \ + %(link_os_extra_spec32)" + +-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \ ++#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \ + %{!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 9ade72114e9..9490b84a153 100644 +--- a/gcc/config/rs6000/sysv4.h ++++ b/gcc/config/rs6000/sysv4.h +@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC + #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER + #endif + +-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ ++#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ + -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" + +diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h +index 6919b468f06..56d52d41b31 100644 +--- a/gcc/config/s390/linux.h ++++ b/gcc/config/s390/linux.h +@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see + + #undef LINK_SPEC + #define LINK_SPEC \ +- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \ ++ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \ + %{shared:-shared} \ + %{!shared: \ + %{static:-static} \ +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 63853e60c03..de6d8675456 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); + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #undef LINK_SPEC +-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ ++#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \ + %{!mno-relax:%{!r:-relax}} \ + %{!shared: \ + %{!static: \ +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 625c9ab7902..7aec9d3a016 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -695,8 +695,11 @@ proper position among the other output files. */ + #ifdef LIBASAN_EARLY_SPEC + #define LIBASAN_SPEC STATIC_LIBASAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) +-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \ +- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \ ++#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \ ++ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " -lasan " \ ++ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ ++ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ + STATIC_LIBASAN_LIBS + #else + #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS +@@ -713,8 +716,11 @@ proper position among the other output files. */ + #ifdef LIBTSAN_EARLY_SPEC + #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) +-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \ +- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ ++#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \ ++ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " -ltsan " \ ++ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ ++ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ + STATIC_LIBTSAN_LIBS + #else + #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS +@@ -731,8 +737,11 @@ proper position among the other output files. */ + #ifdef LIBLSAN_EARLY_SPEC + #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) +-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \ +- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ ++#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \ ++ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " -llsan " \ ++ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ ++ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ + STATIC_LIBLSAN_LIBS + #else + #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS +@@ -747,8 +756,11 @@ proper position among the other output files. */ + #define STATIC_LIBUBSAN_LIBS \ + " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}" + #ifdef HAVE_LD_STATIC_DYNAMIC +-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \ +- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ ++#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \ ++ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " -lubsan " \ ++ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ ++ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ + STATIC_LIBUBSAN_LIBS + #else + #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS +-- +2.28.0 + 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 new file mode 100644 index 000000000..01d7d7d29 --- /dev/null +++ b/cross/gcc-x86_64/0006-Enable-Wformat-and-Wformat-security-by-default.patch @@ -0,0 +1,34 @@ +From c57a8b43401ca9a1b889fa9fd421ac49c3dbd380 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:47:43 +0000 +Subject: [PATCH 06/39] 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 c49da99d395..93f25319005 100644 +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -599,7 +599,7 @@ Warn about function calls with format strings that write past the end + of the destination region. Same as -Wformat-overflow=1. + + Wformat-security +-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) ++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) + Warn about possible security problems with format functions. + + Wformat-signedness +@@ -620,7 +620,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ + Warn about zero-length formats. + + Wformat= +-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2) ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2) + Warn about printf/scanf/strftime/strfmon format string anomalies. + + Wformat-overflow= +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch b/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch new file mode 100644 index 000000000..c2d64dff7 --- /dev/null +++ b/cross/gcc-x86_64/0007-Enable-Wtrampolines-by-default.patch @@ -0,0 +1,25 @@ +From a58dad2c52639422671ac6986c36e48499fc2f20 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:48:24 +0000 +Subject: [PATCH 07/39] 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 8bb65e0e1af..ace932b300d 100644 +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -774,7 +774,7 @@ Common Var(warn_system_headers) Warning + Do not suppress warnings from system headers. + + Wtrampolines +-Common Var(warn_trampolines) Warning ++Common Var(warn_trampolines) Init(1) Warning + Warn whenever a trampoline is generated. + + Wtype-limits +-- +2.28.0 + 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 new file mode 100644 index 000000000..f7d30e3b0 --- /dev/null +++ b/cross/gcc-x86_64/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch @@ -0,0 +1,53 @@ +From 98b2b8f7de60ed1b6b7602124ef6db278cf3c212 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:49:40 +0000 +Subject: [PATCH 08/39] Disable ssp on -nostdlib, -nodefaultlibs and + -ffreestanding Change the buffer size. + +--- + gcc/gcc.c | 8 +++++++- + gcc/params.opt | 2 +- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 7aec9d3a016..daeb4d0c8ea 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -886,6 +886,12 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +@@ -1170,7 +1176,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +diff --git a/gcc/params.opt b/gcc/params.opt +index 4aec480798b..eaecfab37ad 100644 +--- a/gcc/params.opt ++++ b/gcc/params.opt +@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +-- +2.28.0 + 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 new file mode 100644 index 000000000..f8f8eea78 --- /dev/null +++ b/cross/gcc-x86_64/0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch @@ -0,0 +1,54 @@ +From 035775ef38206ed2859500efe5fb42ceec2e858d Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:50:33 +0000 +Subject: [PATCH 09/39] 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 a9391d8d167..f7eee24dc8c 100644 +--- a/libstdc++-v3/po/Makefile.am ++++ b/libstdc++-v3/po/Makefile.am +@@ -38,6 +38,7 @@ MSGFMT = msgfmt + EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) + + .po.mo: ++ 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 a0f84b0cfa0..ab24a47a2fd 100644 +--- a/libstdc++-v3/po/Makefile.in ++++ b/libstdc++-v3/po/Makefile.in +@@ -548,6 +548,7 @@ uninstall-am: + + + .po.mo: ++ env --unset=LD_LIBRARY_PATH \ + $(MSGFMT) -o $@ $< + + all-local: all-local-$(USE_NLS) +-- +2.28.0 + 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 new file mode 100644 index 000000000..49118500f --- /dev/null +++ b/cross/gcc-x86_64/0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch @@ -0,0 +1,28 @@ +From e9875d74e75c601b95dba677bc9e58c869150212 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:52:07 +0000 +Subject: [PATCH 10/39] Don't declare asprintf if defined as a macro. + +--- + include/libiberty.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/libiberty.h b/include/libiberty.h +index 141cb886a85..fa0e78eb62f 100644 +--- a/include/libiberty.h ++++ b/include/libiberty.h +@@ -645,8 +645,11 @@ extern int pwait (int, int *, int); + /* Like sprintf but provides a pointer to malloc'd storage, which must + be freed by the caller. */ + ++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ ++#ifndef asprintf + extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; + #endif ++#endif + + /* Like asprintf but allocates memory without fail. This works like + xmalloc. */ +-- +2.28.0 + 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 new file mode 100644 index 000000000..6a1450675 --- /dev/null +++ b/cross/gcc-x86_64/0011-libiberty-copy-PIC-objects-during-build-process.patch @@ -0,0 +1,24 @@ +From 764e64bba73a7b7eb5154c8537781412252ed33e Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:53:00 +0000 +Subject: [PATCH 11/39] libiberty: copy PIC objects during build process + +--- + libiberty/Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in +index d6b302e02fd..fd39928546f 100644 +--- a/libiberty/Makefile.in ++++ b/libiberty/Makefile.in +@@ -263,6 +263,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0012-libitm-disable-FORTIFY.patch b/cross/gcc-x86_64/0012-libitm-disable-FORTIFY.patch new file mode 100644 index 000000000..ba2e1fa9f --- /dev/null +++ b/cross/gcc-x86_64/0012-libitm-disable-FORTIFY.patch @@ -0,0 +1,33 @@ +From da46d99b1b7661a98064a45bdccf08c1867582b0 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:53:36 +0000 +Subject: [PATCH 12/39] libitm: disable FORTIFY + +--- + libitm/configure.tgt | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/libitm/configure.tgt b/libitm/configure.tgt +index 04109160e91..107b957ece3 100644 +--- a/libitm/configure.tgt ++++ b/libitm/configure.tgt +@@ -46,6 +46,16 @@ if test "$gcc_cv_have_tls" = yes ; then + esac + fi + ++# FIXME: error: inlining failed in call to always_inline ++# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’ ++# : function body can be overwritten at link time ++# Disable Fortify in libitm for now. #508852 ++case "${target}" in ++ *-*-linux*) ++ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE" ++ ;; ++esac ++ + # Map the target cpu to an ARCH sub-directory. At the same time, + # work out any special compilation flags as necessary. + case "${target_cpu}" in +-- +2.28.0 + 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..d0636b2bc --- /dev/null +++ b/cross/gcc-x86_64/0013-libgcc_s.patch @@ -0,0 +1,57 @@ +From 354f2a8ceb70f9f6e1688ba41c1cc1c17ac87329 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Sat, 24 Oct 2015 20:09:53 +0000 +Subject: [PATCH 13/39] libgcc_s + +--- + gcc/config/i386/i386-expand.c | 4 ++-- + libgcc/config/i386/cpuinfo.c | 6 +++--- + libgcc/config/i386/t-linux | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c +index c6033688f51..a60e5162995 100644 +--- a/gcc/config/i386/i386-expand.c ++++ b/gcc/config/i386/i386-expand.c +@@ -10966,10 +10966,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, + { + case IX86_BUILTIN_CPU_INIT: + { +- /* Make it call __cpu_indicator_init in libgcc. */ ++ /* Make it call __cpu_indicator_init_local in libgcc.a. */ + 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 cf5f0884bb4..ed0381e7744 100644 +--- a/libgcc/config/i386/cpuinfo.c ++++ b/libgcc/config/i386/cpuinfo.c +@@ -510,7 +510,7 @@ __cpu_indicator_init (void) + return 0; + } + +-#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.28.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..ed8f503c8 --- /dev/null +++ b/cross/gcc-x86_64/0014-nopie.patch @@ -0,0 +1,75 @@ +From 7fb84007ff62309abffdbddfa751e69c331e82c3 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy +Date: Sat, 7 Nov 2015 02:08:05 +0000 +Subject: [PATCH 14/39] nopie + +--- + gcc/configure | 27 +++++++++++++++++++++++++++ + gcc/configure.ac | 13 +++++++++++++ + 2 files changed, 40 insertions(+) + +diff --git a/gcc/configure b/gcc/configure +index 793530e21cf..2d874d3defe 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -30779,6 +30779,33 @@ fi + $as_echo "$gcc_cv_no_pie" >&6; } + if test "$gcc_cv_no_pie" = "yes"; then + NO_PIE_FLAG="-no-pie" ++else ++ # 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 test "${gcc_cv_nopie+set}" = set; 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 "$gcc_cv_nopie" = "yes"; then ++ NO_PIE_FLAG="-nopie" ++ fi + fi + + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 0fd438e39e5..0b257e687ee 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -6863,6 +6863,19 @@ AC_CACHE_CHECK([for -no-pie option], + LDFLAGS="$saved_LDFLAGS"]) + if test "$gcc_cv_no_pie" = "yes"; then + NO_PIE_FLAG="-no-pie" ++else ++ # Check if -nopie works. ++ AC_CACHE_CHECK([for -nopie option], ++ [gcc_cv_nopie], ++ [saved_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -nopie" ++ AC_LINK_IFELSE([int main(void) {return 0;}], ++ [gcc_cv_nopie=yes], ++ [gcc_cv_nopie=no]) ++ LDFLAGS="$saved_LDFLAGS"]) ++ if test "$gcc_cv_nopie" = "yes"; then ++ NO_PIE_FLAG="-nopie" ++ fi + fi + AC_SUBST([NO_PIE_FLAG]) + +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch b/cross/gcc-x86_64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch new file mode 100644 index 000000000..b7bd1857f --- /dev/null +++ b/cross/gcc-x86_64/0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch @@ -0,0 +1,25 @@ +From 3f764eb6dc371cc48cfdf231cbd40e64b1f2a671 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:57:09 +0000 +Subject: [PATCH 15/39] libffi: use __linux__ instead of __gnu_linux__ for musl + +--- + libffi/src/closures.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libffi/src/closures.c b/libffi/src/closures.c +index 721ff00ea43..22a699c6340 100644 +--- a/libffi/src/closures.c ++++ b/libffi/src/closures.c +@@ -34,7 +34,7 @@ + #include + + #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE +-# if __gnu_linux__ && !defined(__ANDROID__) ++# if __linux__ && !defined(__ANDROID__) + /* This macro indicates it may be forbidden to map anonymous memory + with both write and execute permission. Code compiled when this + option is defined will attempt to map such pages once, but if it +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0016-dlang-update-zlib-binding.patch b/cross/gcc-x86_64/0016-dlang-update-zlib-binding.patch new file mode 100644 index 000000000..b2dcb0eb1 --- /dev/null +++ b/cross/gcc-x86_64/0016-dlang-update-zlib-binding.patch @@ -0,0 +1,425 @@ +From b78dea0f8f09d4092bec52b7ada719ead2552dd2 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:57:51 +0000 +Subject: [PATCH 16/39] dlang: update zlib binding + +--- + libphobos/src/std/zlib.d | 266 ++++++++++++++++++++++++++++----------- + 1 file changed, 196 insertions(+), 70 deletions(-) + +diff --git a/libphobos/src/std/zlib.d b/libphobos/src/std/zlib.d +index e6cce240fd5..bd2fe37ebec 100644 +--- a/libphobos/src/std/zlib.d ++++ b/libphobos/src/std/zlib.d +@@ -1,7 +1,7 @@ + // Written in the D programming language. + + /** +- * Compress/decompress data using the $(HTTP www._zlib.net, _zlib library). ++ * Compress/decompress data using the $(HTTP www.zlib.net, zlib library). + * + * Examples: + * +@@ -43,12 +43,12 @@ + * References: + * $(HTTP en.wikipedia.org/wiki/Zlib, Wikipedia) + * +- * Copyright: Copyright Digital Mars 2000 - 2011. ++ * Copyright: Copyright The D Language Foundation 2000 - 2011. + * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). + * Authors: $(HTTP digitalmars.com, Walter Bright) +- * Source: $(PHOBOSSRC std/_zlib.d) ++ * Source: $(PHOBOSSRC std/zlib.d) + */ +-/* Copyright Digital Mars 2000 - 2011. ++/* Copyright The D Language Foundation 2000 - 2011. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) +@@ -75,9 +75,9 @@ enum + + class ZlibException : Exception + { +- this(int errnum) +- { string msg; +- ++ private static string getmsg(int errnum) nothrow @nogc pure @safe ++ { ++ string msg; + switch (errnum) + { + case Z_STREAM_END: msg = "stream end"; break; +@@ -90,7 +90,12 @@ class ZlibException : Exception + case Z_VERSION_ERROR: msg = "version error"; break; + default: msg = "unknown error"; break; + } +- super(msg); ++ return msg; ++ } ++ ++ this(int errnum) ++ { ++ super(getmsg(errnum)); + } + } + +@@ -104,7 +109,7 @@ class ZlibException : Exception + * buf = buffer containing input data + * + * Returns: +- * A $(D uint) checksum for the provided input data and starting checksum ++ * A `uint` checksum for the provided input data and starting checksum + * + * See_Also: + * $(LINK http://en.wikipedia.org/wiki/Adler-32) +@@ -147,7 +152,7 @@ uint adler32(uint adler, const(void)[] buf) + * buf = buffer containing input data + * + * Returns: +- * A $(D uint) checksum for the provided input data and starting checksum ++ * A `uint` checksum for the provided input data and starting checksum + * + * See_Also: + * $(LINK http://en.wikipedia.org/wiki/Cyclic_redundancy_check) +@@ -191,13 +196,14 @@ uint crc32(uint crc, const(void)[] buf) + ubyte[] compress(const(void)[] srcbuf, int level) + in + { +- assert(-1 <= level && level <= 9); ++ assert(-1 <= level && level <= 9, "Compression level needs to be within [-1, 9]."); + } +-body ++do + { + import core.memory : GC; ++ import std.array : uninitializedArray; + auto destlen = srcbuf.length + ((srcbuf.length + 1023) / 1024) + 12; +- auto destbuf = new ubyte[destlen]; ++ auto destbuf = uninitializedArray!(ubyte[])(destlen); + auto err = etc.c.zlib.compress2(destbuf.ptr, &destlen, cast(ubyte *) srcbuf.ptr, srcbuf.length, level); + if (err) + { +@@ -276,7 +282,7 @@ void[] uncompress(const(void)[] srcbuf, size_t destlen = 0u, int winbits = 15) + throw new ZlibException(err); + } + } +- assert(0); ++ assert(0, "Unreachable code"); + } + + @system unittest +@@ -370,9 +376,9 @@ class Compress + this(int level, HeaderFormat header = HeaderFormat.deflate) + in + { +- assert(1 <= level && level <= 9); ++ assert(1 <= level && level <= 9, "Legal compression level are in [1, 9]."); + } +- body ++ do + { + this.level = level; + this.gzip = header == HeaderFormat.gzip; +@@ -406,6 +412,7 @@ class Compress + const(void)[] compress(const(void)[] buf) + { + import core.memory : GC; ++ import std.array : uninitializedArray; + int err; + ubyte[] destbuf; + +@@ -420,7 +427,7 @@ class Compress + inited = 1; + } + +- destbuf = new ubyte[zs.avail_in + buf.length]; ++ destbuf = uninitializedArray!(ubyte[])(zs.avail_in + buf.length); + zs.next_out = destbuf.ptr; + zs.avail_out = to!uint(destbuf.length); + +@@ -461,9 +468,10 @@ class Compress + void[] flush(int mode = Z_FINISH) + in + { +- assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH); ++ assert(mode == Z_FINISH || mode == Z_SYNC_FLUSH || mode == Z_FULL_FLUSH, ++ "Mode must be either Z_FINISH, Z_SYNC_FLUSH or Z_FULL_FLUSH."); + } +- body ++ do + { + import core.memory : GC; + ubyte[] destbuf; +@@ -523,6 +531,7 @@ class UnCompress + z_stream zs; + int inited; + int done; ++ bool inputEnded; + size_t destbufsize; + + HeaderFormat format; +@@ -571,16 +580,16 @@ class UnCompress + const(void)[] uncompress(const(void)[] buf) + in + { +- assert(!done); ++ assert(!done, "Buffer has been flushed."); + } +- body ++ do + { ++ if (inputEnded || !buf.length) ++ return null; ++ + import core.memory : GC; ++ import std.array : uninitializedArray; + int err; +- ubyte[] destbuf; +- +- if (buf.length == 0) +- return null; + + if (!inited) + { +@@ -598,26 +607,152 @@ class UnCompress + + if (!destbufsize) + destbufsize = to!uint(buf.length) * 2; +- destbuf = new ubyte[zs.avail_in * 2 + destbufsize]; +- zs.next_out = destbuf.ptr; +- zs.avail_out = to!uint(destbuf.length); +- +- if (zs.avail_in) +- buf = zs.next_in[0 .. zs.avail_in] ~ cast(ubyte[]) buf; ++ auto destbuf = uninitializedArray!(ubyte[])(destbufsize); ++ size_t destFill; + + zs.next_in = cast(ubyte*) buf.ptr; + zs.avail_in = to!uint(buf.length); + +- err = inflate(&zs, Z_NO_FLUSH); +- if (err != Z_STREAM_END && err != Z_OK) ++ while (true) + { +- GC.free(destbuf.ptr); +- error(err); ++ auto oldAvailIn = zs.avail_in; ++ ++ zs.next_out = destbuf[destFill .. $].ptr; ++ zs.avail_out = to!uint(destbuf.length - destFill); ++ ++ err = inflate(&zs, Z_NO_FLUSH); ++ if (err == Z_STREAM_END) ++ { ++ inputEnded = true; ++ break; ++ } ++ else if (err != Z_OK) ++ { ++ GC.free(destbuf.ptr); ++ error(err); ++ } ++ else if (!zs.avail_in) ++ break; ++ ++ /* ++ According to the zlib manual inflate() stops when either there's ++ no more data to uncompress or the output buffer is full ++ So at this point, the output buffer is too full ++ */ ++ ++ destFill = destbuf.length; ++ ++ if (destbuf.capacity) ++ { ++ if (destbuf.length < destbuf.capacity) ++ destbuf.length = destbuf.capacity; ++ else ++ { ++ auto newLength = GC.extend(destbuf.ptr, destbufsize, destbufsize); ++ ++ if (newLength && destbuf.length < destbuf.capacity) ++ destbuf.length = destbuf.capacity; ++ else ++ destbuf.length += destbufsize; ++ } ++ } ++ else ++ destbuf.length += destbufsize; + } ++ + destbuf.length = destbuf.length - zs.avail_out; + return destbuf; + } + ++ // Test for issues 3191 and 9505 ++ @system unittest ++ { ++ import std.algorithm.comparison; ++ import std.array; ++ import std.file; ++ import std.zlib; ++ ++ // Data that can be easily compressed ++ ubyte[1024] originalData; ++ ++ // This should yield a compression ratio of at least 1/2 ++ auto compressedData = compress(originalData, 9); ++ assert(compressedData.length < originalData.length / 2, ++ "The compression ratio is too low to accurately test this situation"); ++ ++ auto chunkSize = compressedData.length / 4; ++ assert(chunkSize < compressedData.length, ++ "The length of the compressed data is too small to accurately test this situation"); ++ ++ auto decompressor = new UnCompress(); ++ ubyte[originalData.length] uncompressedData; ++ ubyte[] reusedBuf; ++ int progress; ++ ++ reusedBuf.length = chunkSize; ++ ++ for (int i = 0; i < compressedData.length; i += chunkSize) ++ { ++ auto len = min(chunkSize, compressedData.length - i); ++ // simulate reading from a stream in small chunks ++ reusedBuf[0 .. len] = compressedData[i .. i + len]; ++ ++ // decompress using same input buffer ++ auto chunk = decompressor.uncompress(reusedBuf); ++ assert(progress + chunk.length <= originalData.length, ++ "The uncompressed result is bigger than the original data"); ++ ++ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[]; ++ progress += chunk.length; ++ } ++ ++ auto chunk = decompressor.flush(); ++ assert(progress + chunk.length <= originalData.length, ++ "The uncompressed result is bigger than the original data"); ++ ++ uncompressedData[progress .. progress + chunk.length] = cast(const ubyte[]) chunk[]; ++ progress += chunk.length; ++ ++ assert(progress == originalData.length, ++ "The uncompressed and the original data sizes differ"); ++ assert(originalData[] == uncompressedData[], ++ "The uncompressed and the original data differ"); ++ } ++ ++ @system unittest ++ { ++ ubyte[1024] invalidData; ++ auto decompressor = new UnCompress(); ++ ++ try ++ { ++ auto uncompressedData = decompressor.uncompress(invalidData); ++ } ++ catch (ZlibException e) ++ { ++ assert(e.msg == "data error"); ++ return; ++ } ++ ++ assert(false, "Corrupted data didn't result in an error"); ++ } ++ ++ @system unittest ++ { ++ ubyte[2014] originalData = void; ++ auto compressedData = compress(originalData, 9); ++ ++ auto decompressor = new UnCompress(); ++ auto uncompressedData = decompressor.uncompress(compressedData ~ cast(ubyte[]) "whatever"); ++ ++ assert(originalData.length == uncompressedData.length, ++ "The uncompressed and the original data sizes differ"); ++ assert(originalData[] == uncompressedData[], ++ "The uncompressed and the original data differ"); ++ assert(!decompressor.uncompress("whatever").length, ++ "Compression continued after the end"); ++ } ++ + /** + * Decompress and return any remaining data. + * The returned data should be appended to that returned by uncompress(). +@@ -626,49 +761,40 @@ class UnCompress + void[] flush() + in + { +- assert(!done); ++ assert(!done, "Buffer has been flushed before."); + } + out + { +- assert(done); ++ assert(done, "Flushing failed."); + } +- body ++ do + { +- import core.memory : GC; +- ubyte[] extra; +- ubyte[] destbuf; +- int err; +- + done = 1; +- if (!inited) +- return null; ++ return null; ++ } + +- L1: +- destbuf = new ubyte[zs.avail_in * 2 + 100]; +- zs.next_out = destbuf.ptr; +- zs.avail_out = to!uint(destbuf.length); ++ /// Returns true if all input data has been decompressed and no further data ++ /// can be decompressed (inflate() returned Z_STREAM_END) ++ @property bool empty() const ++ { ++ return inputEnded; ++ } + +- err = etc.c.zlib.inflate(&zs, Z_NO_FLUSH); +- if (err == Z_OK && zs.avail_out == 0) +- { +- extra ~= destbuf; +- goto L1; +- } +- if (err != Z_STREAM_END) +- { +- GC.free(destbuf.ptr); +- if (err == Z_OK) +- err = Z_BUF_ERROR; +- error(err); +- } +- destbuf = destbuf.ptr[0 .. zs.next_out - destbuf.ptr]; +- err = etc.c.zlib.inflateEnd(&zs); +- inited = 0; +- if (err) +- error(err); +- if (extra.length) +- destbuf = extra ~ destbuf; +- return destbuf; ++ /// ++ @system unittest ++ { ++ // some random data ++ ubyte[1024] originalData = void; ++ ++ // append garbage data (or don't, this works in both cases) ++ auto compressedData = cast(ubyte[]) compress(originalData) ~ cast(ubyte[]) "whatever"; ++ ++ auto decompressor = new UnCompress(); ++ auto uncompressedData = decompressor.uncompress(compressedData); ++ ++ assert(uncompressedData[] == originalData[], ++ "The uncompressed and the original data differ"); ++ assert(decompressor.empty, "The UnCompressor reports not being done"); + } + } + +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch b/cross/gcc-x86_64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch new file mode 100644 index 000000000..570c44c4b --- /dev/null +++ b/cross/gcc-x86_64/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch @@ -0,0 +1,51 @@ +From 58c529af8a9673b90dc7137065ab788c25b358a8 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:58:22 +0000 +Subject: [PATCH 17/39] dlang: fix fcntl on mips, add libucontext dep + +--- + libphobos/configure.tgt | 1 + + libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt +index 94e42bf5509..73f2e4b7f01 100644 +--- a/libphobos/configure.tgt ++++ b/libphobos/configure.tgt +@@ -35,6 +35,7 @@ case "${target}" in + ;; + mips*-*-linux*) + LIBPHOBOS_SUPPORTED=yes ++ LIBDRUNTIME_NEEDS_UCONTEXT=yes + ;; + power*-*-linux*) + LIBPHOBOS_SUPPORTED=yes +diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d +index 9febcff849b..cb34e2108bd 100644 +--- a/libphobos/libdruntime/core/sys/posix/fcntl.d ++++ b/libphobos/libdruntime/core/sys/posix/fcntl.d +@@ -870,6 +870,21 @@ else version (CRuntime_Musl) + F_SETLKW = 7, + } + } ++ else version (MIPS_Any) ++ { ++ enum ++ { ++ O_DIRECTORY = 0x010000, // octal 0200000 ++ O_NOFOLLOW = 0x020000, // octal 0400000 ++ O_DIRECT = 0x008000, // octal 0100000 ++ O_LARGEFILE = 0x002000, // octal 0020000 ++ O_TMPFILE = 0x410000, // octal 020200000 ++ ++ F_GETLK = 33, ++ F_SETLK = 34, ++ F_SETLKW = 35, ++ } ++ } + else + static assert(0, "Platform not supported"); + +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0018-ada-fix-shared-linking.patch b/cross/gcc-x86_64/0018-ada-fix-shared-linking.patch new file mode 100644 index 000000000..6486564c1 --- /dev/null +++ b/cross/gcc-x86_64/0018-ada-fix-shared-linking.patch @@ -0,0 +1,42 @@ +From 2a614f9b702b02c312cd513eddb1fc6745f9a3ad Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:59:16 +0000 +Subject: [PATCH 18/39] ada: fix shared linking + +--- + gcc/ada/link.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gcc/ada/link.c b/gcc/ada/link.c +index 02c413a412f..f0e52a87d6e 100644 +--- a/gcc/ada/link.c ++++ b/gcc/ada/link.c +@@ -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.28.0 + diff --git a/cross/gcc-x86_64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch b/cross/gcc-x86_64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch new file mode 100644 index 000000000..788c0fb9b --- /dev/null +++ b/cross/gcc-x86_64/0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch @@ -0,0 +1,24 @@ +From dab36b973223e0d6853f564e845bc22dadcc4d2d Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 06:59:43 +0000 +Subject: [PATCH 19/39] build: fix CXXFLAGS_FOR_BUILD passing + +--- + Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.in b/Makefile.in +index 36e369df6e7..63627db68cf 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -170,6 +170,7 @@ BUILD_EXPORTS = \ + # built for the build system to override those in BASE_FLAGS_TO_PASS. + EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + + # This is the list of directories to built for the host system. +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0020-libstdc-futex-add-time64-compatibility.patch b/cross/gcc-x86_64/0020-libstdc-futex-add-time64-compatibility.patch new file mode 100644 index 000000000..8d5f43888 --- /dev/null +++ b/cross/gcc-x86_64/0020-libstdc-futex-add-time64-compatibility.patch @@ -0,0 +1,32 @@ +From c2efb7703c2ef381a8b1d1cd751222e0a7e10665 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:00:17 +0000 +Subject: [PATCH 20/39] libstdc++: futex: add time64 compatibility + +--- + libstdc++-v3/src/c++11/futex.cc | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc +index c9de11a7ec7..7be702dbeda 100644 +--- a/libstdc++-v3/src/c++11/futex.cc ++++ b/libstdc++-v3/src/c++11/futex.cc +@@ -61,7 +61,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0021-add-fortify-headers-paths.patch b/cross/gcc-x86_64/0021-add-fortify-headers-paths.patch new file mode 100644 index 000000000..0d14a614b --- /dev/null +++ b/cross/gcc-x86_64/0021-add-fortify-headers-paths.patch @@ -0,0 +1,25 @@ +From ca8a8331acef15d0b3b095b8c63539acd1d93e8b Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:01:06 +0000 +Subject: [PATCH 21/39] add fortify-headers paths + +--- + gcc/config/linux.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gcc/config/linux.h b/gcc/config/linux.h +index 95654bcdb5a..d88df8f154a 100644 +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -167,6 +167,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + + #ifdef NATIVE_SYSTEM_HEADER_DIR + #define INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, + #else +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch b/cross/gcc-x86_64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch new file mode 100644 index 000000000..5f1ae3c8c --- /dev/null +++ b/cross/gcc-x86_64/0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch @@ -0,0 +1,31 @@ +From 23468db70f830e99ac138826d28cc33fa71d3405 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 22/39] Alpine musl package provides libssp_nonshared.a. We + link to it unconditionally, as otherwise we get link failures if some objects + are -fstack-protector built and final link happens with -fno-stack-protector. + This seems to be the common case when bootstrapping gcc, the piepatches do + not seem to fully fix the crosstoolchain and bootstrap sequence wrt. + stack-protector flag usage. + +--- + gcc/gcc.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index daeb4d0c8ea..6920bec0fa0 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -894,8 +894,7 @@ proper position among the other output files. */ + + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP +-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +- "|fstack-protector-strong|fstack-protector-explicit:}" ++#define LINK_SSP_SPEC "-lssp_nonshared" + #else + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit" \ +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch b/cross/gcc-x86_64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch new file mode 100644 index 000000000..8d0e39ba5 --- /dev/null +++ b/cross/gcc-x86_64/0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch @@ -0,0 +1,69 @@ +From 67513cb76a43014172f54384c3bad0c41e949c8a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:03:42 +0000 +Subject: [PATCH 23/39] DP: Use --push-state/--pop-state for gold as well when + linking libtsan. + +--- + gcc/gcc.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 6920bec0fa0..40e07354b3d 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -696,10 +696,10 @@ proper position among the other output files. */ + #define LIBASAN_SPEC STATIC_LIBASAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) + #define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \ +- " %{!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 +@@ -717,10 +717,10 @@ proper position among the other output files. */ + #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) + #define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \ +- " %{!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 +@@ -738,10 +738,10 @@ proper position among the other output files. */ + #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) + #define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \ +- " %{!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 +@@ -757,10 +757,10 @@ proper position among the other output files. */ + " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}" + #ifdef HAVE_LD_STATIC_DYNAMIC + #define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \ +- " %{!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.28.0 + diff --git a/cross/gcc-x86_64/0024-Pure-64-bit-MIPS.patch b/cross/gcc-x86_64/0024-Pure-64-bit-MIPS.patch new file mode 100644 index 000000000..55021c8f8 --- /dev/null +++ b/cross/gcc-x86_64/0024-Pure-64-bit-MIPS.patch @@ -0,0 +1,47 @@ +From 5d9d38da4f523c052a5bcd2562d79809b4136f2c Mon Sep 17 00:00:00 2001 +From: Nils Andreas Svee +Date: Thu, 21 Dec 2017 03:14:33 +0100 +Subject: [PATCH 24/39] Pure 64-bit MIPS + +--- + gcc/config/mips/mips.h | 8 ++++---- + gcc/config/mips/t-linux64 | 6 +++--- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h +index 3ce0c19a29a..b9920b49167 100644 +--- a/gcc/config/mips/mips.h ++++ b/gcc/config/mips/mips.h +@@ -3424,11 +3424,11 @@ struct GTY(()) machine_function { + /* If we are *not* using multilibs and the default ABI is not ABI_32 we + need to change these from /lib and /usr/lib. */ + #if MIPS_ABI_DEFAULT == ABI_N32 +-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/" +-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/" ++#define STANDARD_STARTFILE_PREFIX_1 "/lib/" ++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" + #elif MIPS_ABI_DEFAULT == ABI_64 +-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/" +-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/" ++#define STANDARD_STARTFILE_PREFIX_1 "/lib/" ++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" + #endif + + /* Load store bonding is not supported by micromips and fix_24k. The +diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64 +index ceb58d3b5f3..8116e23ebba 100644 +--- a/gcc/config/mips/t-linux64 ++++ b/gcc/config/mips/t-linux64 +@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64 + MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el) + MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft) + MULTILIB_OSDIRNAMES = \ +- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \ +- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \ +- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT)) ++ ../lib \ ++ ../lib32 \ ++ ../lib +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0025-use-pure-64-bit-configuration-where-appropriate.patch b/cross/gcc-x86_64/0025-use-pure-64-bit-configuration-where-appropriate.patch new file mode 100644 index 000000000..2c2d3030b --- /dev/null +++ b/cross/gcc-x86_64/0025-use-pure-64-bit-configuration-where-appropriate.patch @@ -0,0 +1,121 @@ +From ac0eeb3237ac2cf75c19be92afe3335c9a0d83bb Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:04:40 +0000 +Subject: [PATCH 25/39] use pure 64-bit configuration where appropriate + +--- + gcc/config/aarch64/t-aarch64-linux | 2 +- + gcc/config/i386/t-linux64 | 4 ++-- + gcc/config/rs6000/t-linux | 6 ++++-- + gcc/config/rs6000/t-linux64 | 4 ++-- + gcc/config/rs6000/t-linux64bele | 4 ++-- + gcc/config/rs6000/t-linux64lebe | 4 ++-- + gcc/config/s390/t-linux64 | 4 ++-- + 7 files changed, 15 insertions(+), 13 deletions(-) + +diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux +index 83e59e33b85..6ec56fdf6a8 100644 +--- a/gcc/config/aarch64/t-aarch64-linux ++++ b/gcc/config/aarch64/t-aarch64-linux +@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-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) +diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 +index 1171e218578..256f8c079ba 100644 +--- a/gcc/config/i386/t-linux64 ++++ b/gcc/config/i386/t-linux64 +@@ -33,6 +33,6 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) +diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux +index aeb7440c492..ab14c455d8d 100644 +--- a/gcc/config/rs6000/t-linux ++++ b/gcc/config/rs6000/t-linux +@@ -2,7 +2,8 @@ + # or soft-float. + ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) + 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 264a7e27524..d1e460811cc 100644 +--- a/gcc/config/rs6000/t-linux64 ++++ b/gcc/config/rs6000/t-linux64 +@@ -28,8 +28,8 @@ + MULTILIB_OPTIONS := m64/m32 + MULTILIB_DIRNAMES := 64 32 + 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.c + $(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} +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.28.0 + diff --git a/cross/gcc-x86_64/0026-always-build-libgcc_eh.a.patch b/cross/gcc-x86_64/0026-always-build-libgcc_eh.a.patch new file mode 100644 index 000000000..d89d12b8c --- /dev/null +++ b/cross/gcc-x86_64/0026-always-build-libgcc_eh.a.patch @@ -0,0 +1,51 @@ +From 3f35cf750117fa7cbceaf33e4bea008d0688bd93 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:05:41 +0000 +Subject: [PATCH 26/39] 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 851e7657d07..99ec513a1a6 100644 +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -956,8 +956,9 @@ ifneq ($(LIBUNWIND),) + all: libunwind.a + endif + ++all: libgcc_eh.a + 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) +@@ -1159,10 +1160,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)))) +@@ -1179,6 +1176,10 @@ ifeq ($(enable_gcov),yes) + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a + endif + ++ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a ++ + parts="$(INSTALL_PARTS)"; \ + for file in $$parts; do \ + rm -f $(DESTDIR)$(inst_libdir)/$$file; \ +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0027-ada-libgnarl-compatibility-for-musl.patch b/cross/gcc-x86_64/0027-ada-libgnarl-compatibility-for-musl.patch new file mode 100644 index 000000000..15b17fbbd --- /dev/null +++ b/cross/gcc-x86_64/0027-ada-libgnarl-compatibility-for-musl.patch @@ -0,0 +1,135 @@ +From 48342d154084bb9610b8f02f93fcfc2aa606595a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:06:30 +0000 +Subject: [PATCH 27/39] ada: libgnarl compatibility for musl + +--- + gcc/ada/libgnarl/s-osinte__linux.ads | 11 ------ + gcc/ada/libgnarl/s-taprop__linux.adb | 53 ++-------------------------- + 2 files changed, 3 insertions(+), 61 deletions(-) + +diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads +index 80cb2b2a793..701b7a3aeab 100644 +--- a/gcc/ada/libgnarl/s-osinte__linux.ads ++++ b/gcc/ada/libgnarl/s-osinte__linux.ads +@@ -399,12 +399,6 @@ package System.OS_Interface is + PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; + +- 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; +@@ -466,11 +460,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 c45559e5ba0..0b0f173e7d4 100644 +--- a/gcc/ada/libgnarl/s-taprop__linux.adb ++++ b/gcc/ada/libgnarl/s-taprop__linux.adb +@@ -202,9 +202,6 @@ package body System.Task_Primitives.Operations is + pragma Import + (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); + +- 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. +@@ -214,38 +211,6 @@ package body System.Task_Primitives.Operations is + -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on + -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. + +- 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-static call not allowed in preelaborated unit"); +- Ceiling_Support : constant Boolean := Get_Ceiling_Support; +- pragma Warnings (On, "non-static call not allowed in preelaborated unit"); + -- True if the locking policy is Ceiling_Locking, and the current process + -- has permission to use this policy. The process has permission if it is + -- running as 'root', or if the capability was set by the setcap command, +@@ -348,7 +313,9 @@ package body System.Task_Primitives.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; + +@@ -360,16 +327,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); +@@ -409,11 +367,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.28.0 + diff --git a/cross/gcc-x86_64/0028-ada-musl-support-fixes.patch b/cross/gcc-x86_64/0028-ada-musl-support-fixes.patch new file mode 100644 index 000000000..b776c58c5 --- /dev/null +++ b/cross/gcc-x86_64/0028-ada-musl-support-fixes.patch @@ -0,0 +1,223 @@ +From 0d517a7c90f9e21616c8ad0c66e24c1554f6658c Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 21 Aug 2020 07:07:48 +0000 +Subject: [PATCH 28/39] ada: musl support fixes + +--- + gcc/ada/Makefile.rtl | 10 +++++----- + gcc/ada/adaint.c | 34 +++++++++++++++++++--------------- + gcc/ada/adaint.h | 10 ++++------ + gcc/ada/terminals.c | 8 ++++---- + 4 files changed, 32 insertions(+), 30 deletions(-) + +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl +index 55ff9b0f3d5..0fadf4e4b79 100644 +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -1533,7 +1533,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(target_cpu) $(target_os))),) + s-intman.adb + #include + #endif ++ ++#if defined (linux) ++#define _GNU_SOURCE 1 ++#include ++#endif + + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 +@@ -3308,7 +3313,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 +@@ -3318,7 +3322,7 @@ __gnat_lwp_self (void) + + /* Dynamic cpu sets */ + +-cpu_set_t * ++void * + __gnat_cpu_alloc (size_t count) + { + return CPU_ALLOC (count); +@@ -3331,33 +3335,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 +@@ -3367,23 +3371,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__ */ +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 311e240dfcc..1c4d0050103 100644 +--- a/gcc/ada/adaint.h ++++ b/gcc/ada/adaint.h +@@ -316,13 +316,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) +diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c +index af4417fab90..bab6bf3ca87 100644 +--- a/gcc/ada/terminals.c ++++ b/gcc/ada/terminals.c +@@ -1145,7 +1145,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns) + /* POSIX does not specify how to open the master side of a terminal.Several + methods are available (system specific): + 1- using a cloning device (USE_CLONE_DEVICE) +- 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 +@@ -1159,7 +1159,7 @@ __gnat_setup_winsize (void *desc, int rows, int columns) + #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) +@@ -1208,8 +1208,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.28.0 + diff --git a/cross/gcc-x86_64/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch b/cross/gcc-x86_64/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch new file mode 100644 index 000000000..25bb335d0 --- /dev/null +++ b/cross/gcc-x86_64/0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch @@ -0,0 +1,48 @@ +From 3d86ab883c2a67dc9828f73a3d84c9fdb202ec32 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 17:58:08 +0200 +Subject: [PATCH 29/39] gcc-go: Use _off_t type instead of _loff_t +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Taken from Adélie Linux. +--- + libgo/go/syscall/libcall_linux.go | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go +index 88286c07b6e..f8f5cfb5011 100644 +--- a/libgo/go/syscall/libcall_linux.go ++++ b/libgo/go/syscall/libcall_linux.go +@@ -206,19 +206,19 @@ func Gettid() (tid int) { + //sys Setxattr(path string, attr string, data []byte, flags int) (err error) + //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int + +-//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error) +-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t ++//sys splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error) ++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t + func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { +- var lroff _loff_t +- var plroff *_loff_t ++ var lroff _off_t ++ var plroff *_off_t + if roff != nil { +- lroff = _loff_t(*roff) ++ lroff = _off_t(*roff) + plroff = &lroff + } +- var lwoff _loff_t +- var plwoff *_loff_t ++ var lwoff _off_t ++ var plwoff *_off_t + if woff != nil { +- lwoff = _loff_t(*woff) ++ lwoff = _off_t(*woff) + plwoff = &lwoff + } + n, err = splice(rfd, plroff, wfd, plwoff, len, flags) +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0030-gcc-go-Don-t-include-sys-user.h.patch b/cross/gcc-x86_64/0030-gcc-go-Don-t-include-sys-user.h.patch new file mode 100644 index 000000000..8150bebb1 --- /dev/null +++ b/cross/gcc-x86_64/0030-gcc-go-Don-t-include-sys-user.h.patch @@ -0,0 +1,30 @@ +From da63b5262701f91a2261812332f2850be0180634 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 17:58:21 +0200 +Subject: [PATCH 30/39] gcc-go: Don't include sys/user.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Taken from Adélie Linux. +--- + libgo/sysinfo.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c +index 0692fd41eb7..c8d987358d9 100644 +--- a/libgo/sysinfo.c ++++ b/libgo/sysinfo.c +@@ -73,9 +73,6 @@ + #include + #include + #include +-#if defined(HAVE_SYS_USER_H) +-#include +-#endif + #if defined(HAVE_SYS_UTSNAME_H) + #include + #endif +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch b/cross/gcc-x86_64/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch new file mode 100644 index 000000000..186e2d11b --- /dev/null +++ b/cross/gcc-x86_64/0031-gcc-go-Fix-ucontext_t-on-PPC64.patch @@ -0,0 +1,29 @@ +From 18d6d2d1f62a4232340696fb7d68d248c751e416 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 17:59:22 +0200 +Subject: [PATCH 31/39] gcc-go: Fix ucontext_t on PPC64 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Taken from Adélie Linux. +--- + libgo/runtime/go-signal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c +index b429fdb2403..fd1c885f043 100644 +--- a/libgo/runtime/go-signal.c ++++ b/libgo/runtime/go-signal.c +@@ -224,7 +224,7 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused))) + #elif defined(__alpha__) && defined(__linux__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc; + #elif defined(__PPC__) && defined(__linux__) +- ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip; ++ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32]; + #elif defined(__PPC__) && defined(_AIX) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; + #elif defined(__aarch64__) && defined(__linux__) +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch b/cross/gcc-x86_64/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch new file mode 100644 index 000000000..2ecd0ca01 --- /dev/null +++ b/cross/gcc-x86_64/0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch @@ -0,0 +1,43 @@ +From d9942a2e54f69dee9c03e5e4339a6c62473e6845 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 17:59:45 +0200 +Subject: [PATCH 32/39] gcc-go: Fix handling of signal 34 on musl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Taken from Adélie Linux. +--- + libgo/mksigtab.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libgo/mksigtab.sh b/libgo/mksigtab.sh +index 11e4ec436bd..fe866eacb27 100644 +--- a/libgo/mksigtab.sh ++++ b/libgo/mksigtab.sh +@@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}' + checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}' + checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}' + checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}' +-checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}' ++#checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}' + checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}' + checksig _SIGLWP '{_SigNotify, "SIGLWP: reserved signal no longer used by"}' + checksig _SIGFREEZE '{_SigNotify, "SIGFREEZE: special signal used by CPR"}' +@@ -95,10 +95,12 @@ checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (G + + # Special handling of signals 32 and 33 on GNU/Linux systems, + # because they are special to glibc. ++# Signal 34 is additionally special to Linux systems with musl. + if test "${GOOS}" = "linux"; then +- SIGLIST=$SIGLIST"_32__33_" ++ SIGLIST=$SIGLIST"_32__33__34_" + echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */' + echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */' ++ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */' + fi + + if test "${GOOS}" = "aix"; then +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch b/cross/gcc-x86_64/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch new file mode 100644 index 000000000..2234e32e5 --- /dev/null +++ b/cross/gcc-x86_64/0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch @@ -0,0 +1,38 @@ +From 38e7c12086acae4507f9d5067f947431a28c34db Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 18:01:03 +0200 +Subject: [PATCH 33/39] gcc-go: Use int64 type as offset argument for mmap +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Taken from Adélie Linux. +--- + libgo/go/runtime/mem_gccgo.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go +index ba38ebaa9ab..3c9e5ce9461 100644 +--- a/libgo/go/runtime/mem_gccgo.go ++++ b/libgo/go/runtime/mem_gccgo.go +@@ -15,7 +15,7 @@ import ( + //go:linkname sysFree + + //extern mmap +-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer ++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer + + //extern munmap + func munmap(addr unsafe.Pointer, length uintptr) int32 +@@ -37,7 +37,7 @@ func init() { + } + } + +-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) { ++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) { + p := sysMmap(addr, n, prot, flags, fd, off) + if uintptr(p) == _MAP_FAILED { + return nil, errno() +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch b/cross/gcc-x86_64/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch new file mode 100644 index 000000000..40c515ee8 --- /dev/null +++ b/cross/gcc-x86_64/0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch @@ -0,0 +1,38 @@ +From a4e800081081b00539bbb6fd8b5cf6b66504cfaa Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 18:02:28 +0200 +Subject: [PATCH 34/39] gcc-go: Fix st_{a,m,c}tim fields in generated + sysinfo.go +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are more than one st_{a,m,c}tim fields in struct stat on time64 machines. + +Run the Go-isation on all of them. + +Taken from Adélie Linux. +--- + libgo/mksysinfo.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh +index bd2ba32cba1..972e2c379bc 100755 +--- a/libgo/mksysinfo.sh ++++ b/libgo/mksysinfo.sh +@@ -510,9 +510,9 @@ fi | sed -e 's/type _stat64/type Stat_t/' \ + -e 's/st_size/Size/' \ + -e 's/st_blksize/Blksize/' \ + -e 's/st_blocks/Blocks/' \ +- -e 's/st_atim/Atim/' \ +- -e 's/st_mtim/Mtim/' \ +- -e 's/st_ctim/Ctim/' \ ++ -e 's/st_atim/Atim/g' \ ++ -e 's/st_mtim/Mtim/g' \ ++ -e 's/st_ctim/Ctim/g' \ + -e 's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g' \ + -e 's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g' \ + -e 's/\([^a-zA-Z0-9_]\)_st_timespec_t\([^a-zA-Z0-9_]\)/\1StTimespec\2/g' \ +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0035-gcc-go-signal-34-is-special-on-musl-libc.patch b/cross/gcc-x86_64/0035-gcc-go-signal-34-is-special-on-musl-libc.patch new file mode 100644 index 000000000..f4046862d --- /dev/null +++ b/cross/gcc-x86_64/0035-gcc-go-signal-34-is-special-on-musl-libc.patch @@ -0,0 +1,29 @@ +From 57ccf0ad7f0c4b1f998ebfb6cdaa7d1876012d66 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Sun, 30 Aug 2020 18:03:03 +0200 +Subject: [PATCH 35/39] gcc-go: signal 34 is special on musl libc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Taken from Adélie Linux. +--- + libgo/go/runtime/signal_gccgo.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libgo/go/runtime/signal_gccgo.go b/libgo/go/runtime/signal_gccgo.go +index c555712a03c..9e228580d37 100644 +--- a/libgo/go/runtime/signal_gccgo.go ++++ b/libgo/go/runtime/signal_gccgo.go +@@ -106,7 +106,7 @@ func getsig(i uint32) uintptr { + if sigaction(i, nil, &sa) < 0 { + // On GNU/Linux glibc rejects attempts to call + // sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID). +- if GOOS == "linux" && (i == 32 || i == 33) { ++ if GOOS == "linux" && (i == 32 || i == 33 || i == 34) { + return _SIG_DFL + } + throw("sigaction read failure") +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch b/cross/gcc-x86_64/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch new file mode 100644 index 000000000..08d9ca397 --- /dev/null +++ b/cross/gcc-x86_64/0036-gcc-go-Prefer-_off_t-over-_off64_t.patch @@ -0,0 +1,30 @@ +From e6d4cdd4d03cceb01e8ed03bbe7d35b5798abc88 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sun, 30 Aug 2020 19:26:53 +0200 +Subject: [PATCH 36/39] gcc-go: Prefer _off_t over _off64_t + +musl does not seem to have _off64_t. +--- + libgo/mksysinfo.sh | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh +index 972e2c379bc..8d6da15f983 100755 +--- a/libgo/mksysinfo.sh ++++ b/libgo/mksysinfo.sh +@@ -379,11 +379,7 @@ fi + # Some basic types. + echo 'type Size_t _size_t' >> ${OUT} + echo "type Ssize_t _ssize_t" >> ${OUT} +-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then +- echo "type Offset_t _off64_t" >> ${OUT} +-else +- echo "type Offset_t _off_t" >> ${OUT} +-fi ++echo "type Offset_t _off_t" >> ${OUT} + echo "type Mode_t _mode_t" >> ${OUT} + echo "type Pid_t _pid_t" >> ${OUT} + echo "type Uid_t _uid_t" >> ${OUT} +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch b/cross/gcc-x86_64/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch new file mode 100644 index 000000000..c5e4806fe --- /dev/null +++ b/cross/gcc-x86_64/0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch @@ -0,0 +1,27 @@ +From ac54a2afa01a3ebb06346f8dac505f0babbbe1a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sun, 30 Aug 2020 19:27:51 +0200 +Subject: [PATCH 37/39] gcc-go: undef SETCONTEXT_CLOBBERS_TLS in proc.c + +--- + libgo/runtime/proc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c +index 274ce01c0bf..92a540bdde9 100644 +--- a/libgo/runtime/proc.c ++++ b/libgo/runtime/proc.c +@@ -66,6 +66,10 @@ static void gscanstack(G*); + + __thread G *g __asm__(GOSYM_PREFIX "runtime.g"); + ++/* libucontext does not seem to support tlsbase, undef the macro ++ * here to make sure we define initcontext and fixcontext as dummies. */ ++#undef SETCONTEXT_CLOBBERS_TLS ++ + #ifndef SETCONTEXT_CLOBBERS_TLS + + static inline void +-- +2.28.0 + diff --git a/cross/gcc-x86_64/0038-gcc-go-link-to-libucontext.patch b/cross/gcc-x86_64/0038-gcc-go-link-to-libucontext.patch new file mode 100644 index 000000000..5a626f601 --- /dev/null +++ b/cross/gcc-x86_64/0038-gcc-go-link-to-libucontext.patch @@ -0,0 +1,25 @@ +From e456a63af7f0bd1f519de98e74f864be0f73572a Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Mon, 31 Aug 2020 08:59:40 +0200 +Subject: [PATCH 38/39] gcc-go: link to libucontext + +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 63627db68cf..c7f1f84d683 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -48823,7 +48823,7 @@ configure-target-libgo: + esac; \ + module_srcdir=libgo; \ + 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.28.0 + diff --git a/cross/gcc-x86_64/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch b/cross/gcc-x86_64/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch new file mode 100644 index 000000000..b3568a511 --- /dev/null +++ b/cross/gcc-x86_64/0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch @@ -0,0 +1,27 @@ +From f3a1e98d6d4d546bfb749b91c1f3639df905c1d0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Mon, 31 Aug 2020 20:26:56 +0200 +Subject: [PATCH 39/39] gcc-go: Disable printing of unaccessible ppc64 struct + members + +These struct members do not seem to exist on musl. +--- + libgo/runtime/go-signal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c +index fd1c885f043..e845e453332 100644 +--- a/libgo/runtime/go-signal.c ++++ b/libgo/runtime/go-signal.c +@@ -333,7 +333,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u + runtime_printf("sp %X\n", m->sc_regs[30]); + runtime_printf("pc %X\n", m->sc_pc); + } +-#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__linux__) ++#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__) + { + mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; + int i; +-- +2.28.0 + diff --git a/cross/gcc-x86_64/APKBUILD b/cross/gcc-x86_64/APKBUILD new file mode 100644 index 000000000..b8bc3fff9 --- /dev/null +++ b/cross/gcc-x86_64/APKBUILD @@ -0,0 +1,692 @@ +# Automatically generated aport, do not edit! +# Generator: pmbootstrap aportgen gcc-x86_64 +# Based on: main/gcc (from Alpine) + +CTARGET_ARCH=x86_64 +CTARGET="$(arch_to_hostspec ${CTARGET_ARCH})" +LANG_D=false +LANG_OBJC=false +LANG_JAVA=false +LANG_GO=false +LANG_FORTRAN=false +LANG_ADA=false +options="!strip !tracedeps" + +# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH" +# when this variable matches "no*" +BOOTSTRAP="nobuildbase" + +# abuild will only cross compile when this variable is set, but it +# needs to find a valid package database in there for dependency +# resolving, so we set it to /. +CBUILDROOT="/" + +_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" + +pkgname=gcc-x86_64 +_pkgbase=10.2.1 +pkgver=10.2.1_pre0 +[ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2" +[ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross="" +[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" + +pkgname=gcc-x86_64 +pkgrel=0 +pkgdesc="Stage2 cross-compiler for x86_64" +url="https://gcc.gnu.org" +arch="x86_64" +license="GPL-2.0-or-later LGPL-2.1-or-later" +_gccrel=$pkgver-r$pkgrel +depends="isl binutils-x86_64 mpc1" +makedepends_build="gcc g++ paxmark bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev" +makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-x86_64 binutils-x86_64" +subpackages="g++-x86_64:gpp" +[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target" +replaces="libstdc++ binutils" + +: "${LANG_CXX:=true}" +: "${LANG_D:=true}" +: "${LANG_OBJC:=true}" +: "${LANG_GO:=true}" +: "${LANG_FORTRAN:=true}" +: "${LANG_ADA:=true}" + +_libgomp=true +_libgcc=true +_libatomic=true +_libitm=true + +if [ "$CHOST" != "$CTARGET" ]; then + if [ "$BOOTSTRAP" = nolibc ]; then + LANG_CXX=false + LANG_ADA=false + _libgcc=false + _builddir="$srcdir/build-cross-pass2" + else + _builddir="$srcdir/build-cross-final" + fi + LANG_OBJC=false + LANG_GO=false + LANG_FORTRAN=false + LANG_D=false + _libgomp=false + _libatomic=false + _libitm=false + + # reset target flags (should be set in crosscreate abuild) + # fixup flags. seems gcc treats CPPFLAGS as global without + # _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS. + export CFLAGS="$CPPFLAGS $CFLAGS" + export CXXFLAGS="$CPPFLAGS $CXXFLAGS" + unset CPPFLAGS + export CFLAGS_FOR_TARGET=" " + export CXXFLAGS_FOR_TARGET=" " + export LDFLAGS_FOR_TARGET=" " + + STRIP_FOR_TARGET="$CTARGET-strip" +elif [ "$CBUILD" != "$CHOST" ]; then + # fixup flags. seems gcc treats CPPFLAGS as global without + # _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS. + export CFLAGS="$CPPFLAGS $CFLAGS" + export CXXFLAGS="$CPPFLAGS $CXXFLAGS" + unset CPPFLAGS + + # reset flags and cc for build + export CC_FOR_BUILD="gcc" + export CXX_FOR_BUILD="g++" + export CFLAGS_FOR_BUILD=" " + export CXXFLAGS_FOR_BUILD=" " + export LDFLAGS_FOR_BUILD=" " + export CFLAGS_FOR_TARGET=" " + export CXXFLAGS_FOR_TARGET=" " + export LDFLAGS_FOR_TARGET=" " + + # Languages that do not need bootstrapping + LANG_OBJC=false + LANG_GO=false + LANG_FORTRAN=false + LANG_D=false + + STRIP_FOR_TARGET=${CROSS_COMPILE}strip + _builddir="$srcdir/build-cross-native" +else + STRIP_FOR_TARGET=${CROSS_COMPILE}strip + _builddir="$srcdir/build" +fi + +# GDC hasn't been ported to PowerPC +# See libphobos/configure.tgt in GCC sources for supported targets +[ "$CARCH" = ppc64le ] && LANG_D=false + +# libitm has TEXTRELs in ARM build, so disable for now +case "$CTARGET_ARCH" in +arm*) _libitm=false ;; +mips*) _libitm=false ;; +esac + +# Fortran uses libquadmath if toolchain has __float128 +# currently on x86, x86_64 and ia64 +_libquadmath=$LANG_FORTRAN +case "$CTARGET_ARCH" in +x86 | x86_64) _libquadmath=$LANG_FORTRAN ;; +*) _libquadmath=false ;; +esac + +# libatomic is a dependency for openvswitch +$_libatomic && subpackages="$subpackages libatomic::$CTARGET_ARCH" +$_libgcc && subpackages="$subpackages libgcc::$CTARGET_ARCH" +$_libquadmath && subpackages="$subpackages libquadmath::$CTARGET_ARCH" +if $_libgomp; then + depends="$depends libgomp=$_gccrel" + subpackages="$subpackages libgomp::$CTARGET_ARCH" +fi + +_languages=c +if $LANG_CXX; then + _languages="$_languages,c++" +fi +if $LANG_D; then + subpackages="$subpackages libgphobos::$CTARGET_ARCH gcc-gdc$_target:gdc" + _languages="$_languages,d" + makedepends_build="$makedepends_build libucontext-dev" +fi +if $LANG_OBJC; then + subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc" + _languages="$_languages,objc" +fi +if $LANG_GO; then + subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go" + _languages="$_languages,go" +fi +if $LANG_FORTRAN; then + subpackages="$subpackages libgfortran::$CTARGET_ARCH gfortran$_target:gfortran" + _languages="$_languages,fortran" +fi +if $LANG_ADA; then + subpackages="$subpackages libgnat::$CTARGET_ARCH gcc-gnat$_target:gnat" + _languages="$_languages,ada" + [ "$CBUILD" = "$CTARGET" ] && makedepends_build="$makedepends_build gcc-gnat-bootstrap" + [ "$CBUILD" != "$CTARGET" ] && makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross" +fi +makedepends="$makedepends_build $makedepends_host" + +# when using upstream releases, use this URI template +# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz +# +# right now, we are using a git snapshot +source="https://dev.alpinelinux.org/~nenolod/gcc-10.2.1.tar.xz + 0001-posix_memalign.patch + 0002-gcc-poison-system-directories.patch + 0003-Turn-on-Wl-z-relro-z-now-by-default.patch + 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch + 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch + 0006-Enable-Wformat-and-Wformat-security-by-default.patch + 0007-Enable-Wtrampolines-by-default.patch + 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch + 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch + 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch + 0011-libiberty-copy-PIC-objects-during-build-process.patch + 0012-libitm-disable-FORTIFY.patch + 0013-libgcc_s.patch + 0014-nopie.patch + 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch + 0016-dlang-update-zlib-binding.patch + 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch + 0018-ada-fix-shared-linking.patch + 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch + 0020-libstdc-futex-add-time64-compatibility.patch + 0021-add-fortify-headers-paths.patch + 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch + 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch + 0024-Pure-64-bit-MIPS.patch + 0025-use-pure-64-bit-configuration-where-appropriate.patch + 0026-always-build-libgcc_eh.a.patch + 0027-ada-libgnarl-compatibility-for-musl.patch + 0028-ada-musl-support-fixes.patch + 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch + 0030-gcc-go-Don-t-include-sys-user.h.patch + 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch + 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch + 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch + 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch + 0035-gcc-go-signal-34-is-special-on-musl-libc.patch + 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch + 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch + 0038-gcc-go-link-to-libucontext.patch + 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch + " + +# gcc-4.8-build-args.patch + +# we build out-of-tree +_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver} +_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}" +_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}" + +prepare() { + cd "$_gccdir" + + _err= + for i in $source; do + case "$i" in + *.patch) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || _err="$_err $i" + ;; + esac + done + + if [ -n "$_err" ]; then + error "The following patches failed:" + for i in $_err; do + echo " $i" + done + return 1 + fi + + echo ${_pkgbase:-$pkgver} > gcc/BASE-VER +} + +build() { + local _arch_configure= + local _libc_configure= + local _bootstrap_configure= + local _symvers= + + cd "$_gccdir" + + case "$CTARGET" in + aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";; + armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";; + armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";; + armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";; + mips-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";; + mips64-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";; + mips64el-*-*-*) _arch_configure="--with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64";; + mipsel-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-float=soft --with-abi=32";; + powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";; + powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no --enable-targets=powerpcle-linux";; + i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";; + i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=generic --enable-cld";; + s390x-*-*-*) _arch_configure="--with-arch=z196 --with-tune=zEC12 --with-zarch --with-long-double-128 --enable-decimal-float";; + esac + + case "$CTARGET_ARCH" in + mips*) _hash_style_configure="--with-linker-hash-style=sysv" ;; + *) _hash_style_configure="--with-linker-hash-style=gnu" ;; + esac + + case "$CTARGET_LIBC" in + musl) + # musl does not support mudflap, or libsanitizer + # libmpx uses secure_getenv and struct _libc_fpstate not present in musl + # alpine musl provides libssp_nonshared.a, so we don't need libssp either + _libc_configure="--disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer" + _symvers="--disable-symvers" + export libat_cv_have_ifunc=no + ;; + esac + + + case "$BOOTSTRAP" in + nolibc) _bootstrap_configure="--with-newlib --disable-shared --enable-threads=no" ;; + *) _bootstrap_configure="--enable-shared --enable-threads --enable-tls" ;; + esac + + $_libgomp || _bootstrap_configure="$_bootstrap_configure --disable-libgomp" + $_libatomic || _bootstrap_configure="$_bootstrap_configure --disable-libatomic" + $_libitm || _bootstrap_configure="$_bootstrap_configure --disable-libitm" + $_libquadmath || _arch_configure="$_arch_configure --disable-libquadmath" + + msg "Building the following:" + echo "" + echo " CBUILD=$CBUILD" + echo " CHOST=$CHOST" + echo " CTARGET=$CTARGET" + echo " CTARGET_ARCH=$CTARGET_ARCH" + echo " CTARGET_LIBC=$CTARGET_LIBC" + echo " languages=$_languages" + echo " arch_configure=$_arch_configure" + echo " libc_configure=$_libc_configure" + echo " cross_configure=$_cross_configure" + echo " bootstrap_configure=$_bootstrap_configure" + echo " hash_style_configure=$_hash_style_configure" + echo "" + + export CFLAGS="$CFLAGS -O2" + + mkdir -p "$_builddir" + cd "$_builddir" + "$_gccdir"/configure --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --build=${CBUILD} \ + --host=${CHOST} \ + --target=${CTARGET} \ + --with-pkgversion="Alpine $pkgver" \ + --enable-checking=release \ + --disable-fixed-point \ + --disable-libstdcxx-pch \ + --disable-multilib \ + --disable-nls \ + --disable-werror \ + $_symvers \ + --enable-__cxa_atexit \ + --enable-default-pie \ + --enable-default-ssp \ + --enable-cloog-backend \ + --enable-languages=$_languages \ + $_arch_configure \ + $_libc_configure \ + $_cross_configure \ + $_bootstrap_configure \ + --with-system-zlib \ + $_hash_style_configure + make +} + +package() { + cd "$_builddir" + make -j1 DESTDIR="$pkgdir" install + + ln -s gcc "$pkgdir"/usr/bin/cc + + # we dont support gcj -static + # and saving 35MB is not bad. + find "$pkgdir" \( -name libgtkpeer.a \ + -o -name libgjsmalsa.a \ + -o -name libgij.a \) \ + -delete + + # strip debug info from some static libs + find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \ + -o -name libgphobos.a -o -name libgdruntime.a \ + -o -name libmudflap.a -o -name libmudflapth.a \ + -o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \ + -o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \ + -o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \ + -a -type f \ + -exec ${STRIP_FOR_TARGET} -g {} + + + if $_libgomp; then + mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir + fi + if $_libitm; then + mv "$pkgdir"/usr/lib/libitm.spec "$pkgdir"/$_gcclibdir + fi + + # remove ffi + rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi* + find "$pkgdir" -name 'ffi*.h' -delete + + local gdblib=${_target:+$CTARGET/}lib + if [ -d "$pkgdir"/usr/$gdblib/ ]; then + for i in $(find "$pkgdir"/usr/$gdblib/ -type f -maxdepth 1 -name "*-gdb.py"); do + mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib + mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/ + done + fi + + paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1 + + # move ada runtime libs + if $LANG_ADA; then + for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do + mv "$i" "$pkgdir"/usr/lib/ + ln -s ../../../../${i##*/} $i + done + fi + + if [ "$CHOST" != "$CTARGET" ]; then + # cross-gcc: remove any files that would conflict with the + # native gcc package + rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share + # libcc1 does not depend on target, don't ship it + rm -rf "$pkgdir"/usr/lib/libcc1.so* + + # fixup gcc library symlinks to be linker scripts so + # linker finds the libs from relocated sysroot + for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do + if [ -h "$so" ]; then + local _real=$(basename "$(readlink "$so")") + rm -f "$so" + echo "GROUP ($_real)" > "$so" + fi + done + else + # add c89/c99 wrapper scripts + cat >"$pkgdir"/usr/bin/c89 <<'EOF' +#!/bin/sh +_flavor="-std=c89" +for opt; do + case "$opt" in + -ansi|-std=c89|-std=iso9899:1990) _flavor="";; + -std=*) echo "$(basename $0) called with non ANSI/ISO C option $opt" >&2 + exit 1;; + esac +done +exec gcc $_flavor ${1+"$@"} +EOF + cat >"$pkgdir"/usr/bin/c99 <<'EOF' +#!/bin/sh +_flavor="-std=c99" +for opt; do + case "$opt" in + -std=c99|-std=iso9899:1999) _flavor="";; + -std=*) echo "$(basename $0) called with non ISO C99 option $opt" >&2 + exit 1;; + esac +done +exec gcc $_flavor ${1+"$@"} +EOF + chmod 755 "$pkgdir"/usr/bin/c?9 + + # install lto plugin so regular binutils may use it + mkdir -p "$pkgdir"/usr/lib/bfd-plugins + ln -s /$_gcclibexec/liblto_plugin.so "$pkgdir/usr/lib/bfd-plugins/" + fi +} + +libatomic() { + pkgdesc="GCC Atomic library" + depends= + replaces="gcc" + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/ +} + +libcxx() { + pkgdesc="GNU C++ standard runtime library" + depends= + + if [ "$CHOST" = "$CTARGET" ]; then + # verify that we are using clock_gettime rather than doing direct syscalls + # so we dont break 32 bit arches due to time64. + nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime + fi + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/ +} + +gpp() { + pkgdesc="GNU C++ standard library and compiler" + depends="libstdc++=$_gccrel gcc=$_gccrel libc-dev" + mkdir -p "$subpkgdir/$_gcclibexec" \ + "$subpkgdir"/usr/bin \ + "$subpkgdir"/usr/${_target:+$CTARGET/}include \ + "$subpkgdir"/usr/${_target:+$CTARGET/}lib \ + + mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/" + paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus" + + mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/ + mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/ + mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/ +} + +libobjc() { + pkgdesc="GNU Objective-C runtime" + replaces="objc" + depends= + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/ +} + +objc() { + pkgdesc="GNU Objective-C" + replaces="gcc" + depends="libc-dev gcc=$_gccrel libobjc=$_gccrel" + + mkdir -p "$subpkgdir/$_gcclibexec" \ + "$subpkgdir"/$_gcclibdir/include \ + "$subpkgdir"/usr/lib + mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/" + mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/ + mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \ + "$subpkgdir"/usr/lib/ +} + +libgcc() { + pkgdesc="GNU C compiler runtime libraries" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/ +} + +libgomp() { + pkgdesc="GCC shared-memory parallel programming API library" + depends= + replaces="gcc" + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/ +} + +libgphobos() { + pkgdesc="D programming language standard library for GCC" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/ +} + +gdc() { + pkgdesc="GCC-based D language compiler" + depends="gcc=$_gccrel libgphobos=$_gccrel musl-dev" + depends="$depends libucontext-dev" + + mkdir -p "$subpkgdir/$_gcclibexec" \ + "$subpkgdir"/$_gcclibdir/include/d/ \ + "$subpkgdir"/usr/lib \ + "$subpkgdir"/usr/bin + # Copy: The installed '.d' files, the static lib, the binary itself + # The shared libs are part of 'libgphobos' so one can run program + # without installing the compiler + mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/" + mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/ + mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/ +} + + +libgo() { + pkgdesc="Go runtime library for GCC" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/ +} + +go() { + pkgdesc="Go support for GCC" + depends="gcc=$_gccrel libgo=$_gccrel !go" + + mkdir -p "$subpkgdir"/$_gcclibexec \ + "$subpkgdir"/usr/lib \ + "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin + mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/usr/lib/libgo.a \ + "$pkgdir"/usr/lib/libgo.so \ + "$pkgdir"/usr/lib/libgobegin.a \ + "$pkgdir"/usr/lib/libgolibbegin.a \ + "$subpkgdir"/usr/lib/ +} + +libgfortran() { + pkgdesc="Fortran runtime library for GCC" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/ +} + +libquadmath() { + replaces="gcc" + pkgdesc="128-bit math library for GCC" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/ +} + +gfortran() { + pkgdesc="GNU Fortran Compiler" + depends="gcc=$_gccrel libgfortran=$_gccrel" + $_libquadmath && depends="$depends libquadmath=$_gccrel" + replaces="gcc" + + mkdir -p "$subpkgdir"/$_gcclibexec \ + "$subpkgdir"/$_gcclibdir \ + "$subpkgdir"/usr/lib \ + "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/lib/libgfortran.a \ + "$pkgdir"/usr/lib/libgfortran.so \ + "$subpkgdir"/usr/lib/ + if $_libquadmath; then + mv "$pkgdir"/usr/lib/libquadmath.a \ + "$pkgdir"/usr/lib/libquadmath.so \ + "$subpkgdir"/usr/lib/ + fi + mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/ + mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec + mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir +} + +libgnat() { + pkgdesc="GNU Ada runtime shared libraries" + depends= + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/ +} + +gnat() { + pkgdesc="Ada support for GCC" + depends="gcc=$_gccrel" + provides="$pkgname-gnat-bootstrap" + [ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel" + + mkdir -p "$subpkgdir"/$_gcclibexec \ + "$subpkgdir"/$_gcclibdir \ + "$subpkgdir"/usr/bin + mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/ + mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/ +} + +sha512sums="30c3e36c6e001d172b6219dbf5f0383655d29cbed8a197e1d6139213aacbfdb7cbca63553eedf3a4b35bd445a87ee0f555838d8b2cd7a46ab6bba7951a6b60c5 gcc-10.2.1.tar.xz +571e689369e1fd8a9281fed29f9ce5d35cdb6f892f5118216b2b171c5cd16ba5ab1f8f25f8438760bd26bc649b8f4703cc4e7a0918c250933398a37132fb3266 0001-posix_memalign.patch +2ca7d07543105955525e28a899f9cfbafa3f4f58cce8ae9931c20ddebe1126119a5001b8654e3ff7762f84de882dd609ae87f987b31a53dba6d6f5c7b6374a81 0002-gcc-poison-system-directories.patch +772b1bbae7c12cecef87d696603c523d5ea94a6c27f020f5873e6011479e43af735690a1137d4ec2a086946460ce4d411d5a9f00491015a73b04df39942d6dcd 0003-Turn-on-Wl-z-relro-z-now-by-default.patch +5d785525371fdfe89c5c36edf8c694083fc5d25870ef529473386de51e1db2f846d55a48087099230028acc1d076ad29c159603249aedc695cdf14844e2b26c7 0004-Turn-on-D_FORTIFY_SOURCE-2-by-default-for-C-C-ObjC-O.patch +f467e975f904c01339696f27113ddccac321ef205db4855d46a2a7e9f4ec93e5ab5f9adc19e36a4ef6f61e87fcf9b089ea0727f3ea9736561fb4e9eec4bbf9b0 0005-On-linux-targets-pass-as-needed-by-default-to-the-li.patch +49919bcbd59aea56be90e209d299ddb7b7a295d1db438a769279f4fe57ccf7a028a68227e31a22c1370037a4946a4c7c9ed5ac5044c163fb0f3795d3a2dc26cd 0006-Enable-Wformat-and-Wformat-security-by-default.patch +8374eaa22ef5f26d63226ded57042a8d7d2b69b415e3ff87ec2fc5046404dc062e2e096f329062d047d4e741ed2c5b58b6e1695cf070308f36c9558c6098fdcc 0007-Enable-Wtrampolines-by-default.patch +6be0db2455f5f678d37506773e4493a3cbaefd951486edb3374803813c749c2e6064218950cdc1c06f491fd95d4bd6ae9cbdf83148b332d172c20903eca03aa1 0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.patch +d1d1a87177623439a929b42af57a997b48d9e1f6a4ff06b4f84c5f027fc461473dd36145671d2d61b50c0acfcf028d3361be9c95b3340e6e336b012de84f4252 0009-Ensure-that-msgfmt-doesn-t-encounter-problems-during.patch +167cc80faa6a9daca1a990e87bfc268f27cb620fcd488405f24e397b9a1d6f51a0238d85be4a87f2db93fc1e06ff05d569ce0a2e2fe4db65ec44e15dfb66b994 0010-Don-t-declare-asprintf-if-defined-as-a-macro.patch +85327918c409bf982c0dc13895324d6fc9cef1c68a3969ba5cf0a9450f2a04e3fa858af5ef7e432fc578cf6b0631cec55921bdcd361724c928eea943b4b5b2f3 0011-libiberty-copy-PIC-objects-during-build-process.patch +f65784f4eebec688f51598a306b9d034ba7feb0c6ac35a45e4f59585097fff820b3de90613941603985cdb5ee1a4c630381146bf2ee8429ffe80f0ffd5aa22c1 0012-libitm-disable-FORTIFY.patch +c489306880b493c92796e145dad372976ff90e42d8a97211e91db59bc75ca20244c96456dc806fd30f878f95878a37f4211f58b0f527b5808467a245186a0e14 0013-libgcc_s.patch +67a045fb5588eeb6776a98fbc0280a97e8b06e26909cab3e55346f6c81d87cf9ed7515afa3648b92ddd455e182fd5e44f6094e44f701676817f9d6fc3aad319e 0014-nopie.patch +b559a0f380065bd62d69359813e855819950a82c2361aa85771081de68bfe5d652936fbe5ad762f029016c643ffc8d62c0bf0e90460bd7d62a1c0f89ddcb5491 0015-libffi-use-__linux__-instead-of-__gnu_linux__-for-mu.patch +a42d56b0346208adb4a9f8575d53519c6303ead4eb498bed2ff36b9c20d904d9e1ba5996ec8ee35fb39ba91f30be28a6ab6c3c537a21078670c3ae88762b9a5b 0016-dlang-update-zlib-binding.patch +72313fd4829c8d153b8f4654863ff959597ac25fe657d641cfb5eafb42ae58662dd8581ac7a09eb6dadd2797e3585376fdd1f0207f23c061febdc37a85ea1ba1 0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch +8f695b5f60d2effca4144373fb0e2d3f1ce4a0c4465669ffb3dd771794b0e18da73b2c3e3644403e91c786ad0c42b54bfeac22543280d40c1a1c2b441c434410 0018-ada-fix-shared-linking.patch +c6800ce569e2da9a379bbb94f1f064833ba66ea1e4dc555e66c45f4ab9e83f40264ca0d06d161df469449b05ddf04907f890b39a1fa8a2bc3e530777d4896371 0019-build-fix-CXXFLAGS_FOR_BUILD-passing.patch +5557ec2a754cd64451a8f186397ff79c509d5781a3e32ba11e6ea45356b13d28ba0b959663540d25725e4bd20934c029a90343bed03b2c0bd143ea73c7f47281 0020-libstdc-futex-add-time64-compatibility.patch +1844d044b1eb3cc72ef72c7efb0623d08d62bbb059dcc254524a378bcc37193126eb52894f6acfea31240457e51c435e28573346d3a19d3d045d12846c07ff8d 0021-add-fortify-headers-paths.patch +210b6a16411c1e5fd00c96c06472c3b7713417ef6f48ea8d127482664d63db8ff5226be2cb2b93420e5f153d96b48e02ba4937d2ad7172c6a0e52ac91a050a2d 0022-Alpine-musl-package-provides-libssp_nonshared.a.-We-.patch +4a1daeb55c1103b9b52061eb08a3782307e4c9e1a72f4fc20aaa1ecca02931a9678d6a71cbcf8aaf8898da4c95ad639f8d04de07f169d95c16fc58d0db31602e 0023-DP-Use-push-state-pop-state-for-gold-as-well-when-li.patch +80729605dac33f225eebecbcf6c319e2839c6924483a13bc186092f15f325bf3e972f68328546e394d9e216de0b00e6601ba768b0bb2633ff8c3c0747bb7b1fd 0024-Pure-64-bit-MIPS.patch +ba222bd9ceb95ea9aa729618b95ee81299d20dd5a7840bff47a046d92247e1ea9e2f65d192b1570724da5898fa950a0b8692d505b5c27005d4b143301fd86a52 0025-use-pure-64-bit-configuration-where-appropriate.patch +67e4426be0aeab6b62d7b5e72443f4ea71e4f3fab096b734d656601ad47d44120ef1d9fc87dfef6af2808b39d21cc161cf3d3e45744bd79b56a1071bef5cde94 0026-always-build-libgcc_eh.a.patch +1f9a62459a511a97620147b357a8d1129d1f33a45b3db3a16e049e33b62c23886c37b10152254e84a86d0d2736de06e68e029cf96fa607cf52f15d58e4925b94 0027-ada-libgnarl-compatibility-for-musl.patch +d610a309aebc1aa3a13ce57a69a185b129b02e34cac0f25d7ea3b1dde28551de5e0acc8952b7c877d1f63cbf8f245fb78555d41fee6a55d4d5f68fe92b6a3037 0028-ada-musl-support-fixes.patch +dfa4e5da6206793c63cffef67cf02a443116e63649e6b0466d3c6e24082e5f14eb2640fb9b1b433d2cc4d4755804a360b1b4c572f50638f27169c9f2ef271bdc 0029-gcc-go-Use-_off_t-type-instead-of-_loff_t.patch +22aec9116a2dc32add10efcf6bdc502933a318c668aaa9f01d9e7d6aebc1221fd8e6858abd610c556582f9cad0bc15ff7fbb08ca6c7fbe483c481cec3f361712 0030-gcc-go-Don-t-include-sys-user.h.patch +274b227d5d28e9c1d90ce1e29d5d88f938ea775cdd536bd51c8941a55994103ffb37222e395ab36b2fe4676aef106bb63bd510f73590e2ae434f4c6904454363 0031-gcc-go-Fix-ucontext_t-on-PPC64.patch +3c06cf909d3b07a7de89c67afa6596fdc4ed4445ddc299d3b037dab8cb08828726aa7136576ba6b36f4c8b80451215bc356c8f9141b1e1420010f1ad5444943f 0032-gcc-go-Fix-handling-of-signal-34-on-musl.patch +f0b6f30c6d934c751ab5d58f3656ab80e02ceac12954a124600b09f2de350ad5a2081a09c2eb5c046fe1969af5022ac27b3bc0c0652cd1986b402334825ca92d 0033-gcc-go-Use-int64-type-as-offset-argument-for-mmap.patch +7800ae263f8510341cfc4b0daf5771e309f8ac1df9b8b9ad199eb6c792a13d1550f59584a89eda396514692e43940f5f52039cdef64f49a3e1b9ef40282d81be 0034-gcc-go-Fix-st_-a-m-c-tim-fields-in-generated-sysinfo.patch +33ae7f190b29667d2740e5f8edb6e69946f5601c3d87e2874cb7314bdfaef798223c018006a1d1932a547d1139ebbce08c3cb8b5f563413eb2ae64b9b8668a1e 0035-gcc-go-signal-34-is-special-on-musl-libc.patch +5f56cecf4b1a00c47c58d75ac8390009d80c8733e63cda90483cbbcb2e89d4e63778e475292378df77e6d2b81603dc43f27b8bb9a36ea384a429f501e6e88eed 0036-gcc-go-Prefer-_off_t-over-_off64_t.patch +a4d3396a34e88723740fe52451992082974ddd2336257d173726f08955806349cbee9ddf1d9ec634365d374a0d61f6b28496ca326fba007b151bc3bed3097fa6 0037-gcc-go-undef-SETCONTEXT_CLOBBERS_TLS-in-proc.c.patch +85e1f94113cf9e6be00be810b484b2098913ddb6b9f088351e0ae4d96afe5782d7c8687dacda1db8ee7487d14f67ef836bcfe890e94221b6c112c587e373afe0 0038-gcc-go-link-to-libucontext.patch +d332bf5b2af982776aacee359737145b636eaf373214fc58f66666ec6add5032ae1d2cbff6380c0791a0a8010f3c73a68407cd8908385a9bb2ba0295ea3e2370 0039-gcc-go-Disable-printing-of-unaccessible-ppc64-struct.patch"